I'm using the tableplot
command form the tabplot
package. I wonder how values between 0 and 1 are handled, when tableplot calculates the logs.
In the documentary in found:
If needed logarithmic scaling can be applied to numeric values, where the logs of negative values are calculated via their absolute value and plotted to the left of the zero value line and zero values are simply plotted on this line."
But how does it handle values between 0 and 1?
I tried to get an idea, maybe someone else gets it. My approach:
library(ggplot2)
library(tabplot)
fg <- seq(0,1,length=100)
gh <- seq(0,1,length=100)
myframe <- as.data.frame(cbind(fg,gh))
tableplot(myframe, numPals="Greys", sortCol=fg, nBins=100,scales=c("lin", "log"))
And the output:
Can anyone interpret this? In the plot "fg" contains values from 0 to 1. "gh" shows the corresponding logs to "fg" (calculated by tableplot()).
Problem: The second element of "fg" is: 0.01010101. log10(0.01010101)=-1.995635. So, what happens here?
Note: nBin=100, so all values (100) should be plotted.
I found the answer myself. If the value is between 0 and 1, tableplot() calculates +1 and takes the logarithm:
Normal log: The second element of "fg" is: 0.01010101 => log10(0.01010101)=-1.995635.
Tableplot calculates: log10(1+0.01010101)=0.004364805.