R 3.2.3中的ggplot2:层坏了吗?

Arm*_*roi 7 macos plot r ggplot2

今天早上我升级到R 3.2.3(OSX 10.11.1).我的以下类型的ggplot2脚本突然停止工作:

df <- data.frame(ind = c(20,35,45,55,70), dep = c(6,17,26,37,44))
Run Code Online (Sandbox Code Playgroud)

语法1:

ggplot()+ layer(data=df, mapping=aes(x=ind, y=dep), geom="point")

"Error: Attempted to create layer with no stat."
Run Code Online (Sandbox Code Playgroud)

ggplot2本身并没有破坏

语法2:

ggplot(df, aes(x=ind, y=dep)) + geom_point()
Run Code Online (Sandbox Code Playgroud)

产生预期的情节.语法1仍然在旧机器上生成预期的绘图(R 2.15.3 OSX 10.5.8).此外,我在R升级前的今天早上才使用它.我删除并重新加载了R3.2.3,ggplot2和dependents,但问题仍然存在.我喜欢Syntax 1,因为我喜欢从不同的数据集中添加图层.我很感激你的想法.

Aru*_*esh 0

大多数情况下,当我们在函数层应用 stat="identity",position_dodge(width=3) 时,效果很好

ggplot()+ layer(data=df, mapping=aes(x=ind, y=dep), geom="point",stat="identity",position_dodge(width=3))

#data

df <- data.frame(ind = c(20,35,45,55,70), dep = c(6,17,26,37,44))
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述