0
我刚刚遇到一个错误,同时使用ggplot2和qplot函数(请参阅下面的警告和错误),我不知道如何进行更改,以便它将工作。我查看了与此问题相关的过去文章,但仍无法更正代码。ggplot2,qplot,关于stat_count()的警告和错误
任何人都可以给我一些建议吗?
> library(ggplot2)
Warning message: package ‘ggplot2’ was built under R version 3.2.5
> dodge <- position_dodge(width = .9)
> plot <- qplot(happening, target.looking_M, data=d.c2.subjects, stat="identity",
+ geom="bar", position=dodge,
+ ylab="Proportion of looks", xlab="happening",
+ fill=happening, colour=happening,
+ main="Proportion target looking by condition and testing phase for each single subject")
警告消息:
1: `stat` is deprecated 2: `position` is deprecated
> plot <- plot + facet_grid(type ~ subjectname)
> plot
Error: stat_count() must not be used with a y aesthetic.
请花时间学习和输入(如有必要,请使用IDE代码段扩展)完整的ggplot2'geom_''s。 (a)您最终会制作更好的图表(b)您将更好地使用您的IDE(c)我花了一些可衡量的时间从ggplot2中移除qplot示例。考虑到你看到的其他一些消息,你应该尽量保持你的R环境(基本二进制R安装和软件包)更平等。 – hrbrmstr