asdf<-runif(5)
ghjk<-c("A", "B", "C", "D", "E")
A1<-as.data.frame(cbind(asdf, ghjk))
A1[[1]]<-as.numeric(as.character(A1[[1]]))
ggplot(data=A1)+
geom_point(aes(x=ghjk, y=asdf))+
scale_y_continuous(limits=c(0, 1), formatter="percent")
Is that what you're looking for?
Brandon
Thanks for the ideas. Sorry for the delay in following up. This just
documents for completeness.
Here's was the problem and solution..(rather obvious when you come back
at it):
x <-abs(rnorm(100))
df <-data.frame(x)
df$rate <- df$x/100
ggplot(df)+geom_point(aes(x=x,
y=rate))+scale_y_continuous(formatter='percent')
Works fine.
In my dataset, range was 0-3%... Say I wanted 0-10% on the Y axis.
ggplot(df)+geom_point(aes(x=x,
y=rate))+scale_y_continuous(formatter='percent')+ylim(0,0.1)
Does not do as expected, and forces the y scale back to decimal notation.
ggplot(df)+geom_point(aes(x=x,
y=rate))+scale_y_continuous(formatter='percent', limits=c(0,0.1))
works fine.
The ylim documentation might be improved to note interaction with
formatter, or the code might be improved to handle formatter interactions.
As always, thanks to Hadley.