6268 1

[问答] R语言ggplot2作图中stat应用的疑问 [推广有奖]

  • 0关注
  • 0粉丝

本科生

10%

还不是VIP/贵宾

-

威望
0
论坛币
529 个
通用积分
4.0000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
3253 点
帖子
17
精华
0
在线时间
137 小时
注册时间
2016-2-21
最后登录
2022-8-24

楼主
甲基硫四氮唑9 发表于 2018-9-13 11:42:07 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
如下所示代码:
qplot(x=cut, y=price, data = diamonds, fill=cut, geom = "bar",
      stat="summary", fun.y="mean")
出现以下错误:
Warning: Ignoring unknown parameters: fun.y
Error: stat_bin() must not be used with a y aesthetic.
In addition: Warning message:
`stat` is deprecated

有2点疑问:① 最近学习ggplot中,在qplot中stat=“identity”老是报错`stat` is deprecated
                   ②为什么人家的fun.y能跑出来,我这儿跑不出来
              
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:ggplot2 gplot plot R语言 GPL

沙发
narcissism0923 发表于 2018-9-14 21:50:34
跳过qplot,直接用ggplot:
  1. diamonds %>%
  2.   ggplot(aes(cut, price, fill = cut)) +
  3.   stat_summary(fun.y = mean, geom  = "bar")
复制代码

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-30 19:32