I seem to be having problems using ggplot2. I get the following error while trying to plot box plots with the aes_string:
> Error: stat_boxplot requires the following missing aesthetics: x, y
Here is an example:x='group' y='value' df=data.frame(group=c('A','A','B','B','C','C'),value=c(1,2,3,4,5,6)) ggplot(data=df,aes_string(x,y)) + geom_boxplot() #returns the error ggplot(data=df,aes(x,y)) + geom_boxplot() #plots nonsense (naturally) ggplot(data=df,aes(group,value)) + geom_boxplot() #works, but not strings
Any suggestions on how I can make this work with strings?
I seem to be having problems using ggplot2. I get the following error while trying to plot box plots with the aes_string:
> Error: stat_boxplot requires the following missing aesthetics: x, y
Here is an example:
x='group' y='value' df=data.frame(group=c('A','A','B','B','C','C'),value=c(1,2,3,4,5,6)) ggplot(data=df,aes_string(x,y)) + geom_boxplot() #returns the error ggplot(data=df,aes(x,y)) + geom_boxplot() #plots nonsense (naturally) ggplot(data=df,aes(group,value)) + geom_boxplot() #works, but not strings
Any suggestions on how I can make this work with strings?
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2