hadley/ggplot2 — Issue #278: reverse scaling with unordered factors
Author: djmurphy420
Created: 2011-12-05 16:51:14+00:00
State: open

Context: Last example in coord_trans(), 0.9.0 development version

df <- data.frame(a = abs(rnorm(26)),letters)
plot <- ggplot(df,aes(a,letters)) + geom_point()

# Transforms on 'a' work fine...but
plot + coord_trans(x = "sqrt", y = "reverse")
Error in -x : invalid argument to unary operator
In addition: Warning messages:
1: In log(x, base) : NaNs produced
2: In log(x, base) : NaNs produced
3: In log(x, base) : NaNs produced

str(df)
'data.frame': 26 obs. of 2 variables:
$ a : num 0.000269 0.507335 0.235652 0.804319 0.223722 ...
$ letters: Factor w/ 26 levels "a","b","c","d",..: 1 2 3 4 5 6 7 8 9 10 ...

Dennis