Closed apepper closed 12 years ago
What behaviour do you expect? Log scales don't work with zeros.
What I found so far: 2^x can never be zero ("simple" math). So it outliers
in StatBoxplot->calculate
is NA NA NA NA NA
.
So this is more a general question: How to deal with zeros in set that should be logarithmic?
> log2(0)
[1] -Inf
It is impossible to draw a finite scale that goes to infinity. If a set has zeros, then a logarithmic transformation does not make any sense. Perhaps with context, an alternative can be suggested, but this is not a bug. Consider posting on the ggplot mailing list or r-help list for general discussion of this problem.
I see that this is more a math problem than a ggplot2 problem. But one thing, that could be improved is the error-message to know, that log2(0) is not a good idea. The current error message is quite cryptic (Error in if (any(outliers)) stats[c(1, 5)] <- range(y[!outliers], na.rm = TRUE)
)
Hi there. When I have a dataframe, that contains alot of zeros so all quartiles are zero and no outliers exists, ggplot2 fails when trying to run it with a log2 scale. Without the log2 scale it works fine. I'm running
R version 2.13.2
andggplot2 Version: 0.8.9
.Minimal Example:
Error Message (parts in german):