相关疑难解决方法(0)

ggplot2将变量映射到y并使用stat ="bin"时出错

我正在使用ggplot2来制作直方图:

geom_histogram(aes(x=...), y="..ncount../sum(..ncount..)")
Run Code Online (Sandbox Code Playgroud)

我收到错误:

Mapping a variable to y and also using stat="bin".
  With stat="bin", it will attempt to set the y value to the count of cases in each group.
  This can result in unexpected behavior and will not be allowed in a future version of ggplot2.
  If you want y to represent counts of cases, use stat="bin" and don't map a variable to y.
  If you want y to represent values in the data, use stat="identity".
  See ?geom_bar …
Run Code Online (Sandbox Code Playgroud)

r ggplot2

16
推荐指数
2
解决办法
2万
查看次数

标签 统计

ggplot2 ×1

r ×1