Gad Abraham
unread,Dec 12, 2012, 6:49:25 PM12/12/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ggp...@googlegroups.com
Hi,
I'm trying to jitter the rug in a density plot, but can't get it going, where do I need to specify y:
> library(ggplot2)
> d <- data.frame(x=rnorm(100), y=factor(sample(0:1, 100, replace=TRUE)))
> ggplot(d, aes(x, colour=y)) + geom_density() + geom_rug() # works fine
> ggplot(d, aes(x, colour=y)) + geom_density() + geom_rug(position="jitter")
Error: position_jitter requires the following missing aesthetics: y
Thanks,
Gad
> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_0.9.3
loaded via a namespace (and not attached):
[1] colorspace_1.2-0 dichromat_1.2-4 digest_0.6.0 grid_2.15.2 gtable_0.1.2 labeling_0.1 MASS_7.3-22 munsell_0.4
[9] plyr_1.8 proto_0.3-9.2 RColorBrewer_1.0-5 reshape2_1.2.2 scales_0.2.3 stringr_0.6.2 tools_2.15.2