Ggplot2 in R 3.2.3: slots broken?

This morning I upgraded to R 3.2.3 (OSX 10.11.1). My ggplot2 scripts of the following form suddenly stopped working:

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

syntax 1 :

 ggplot()+ layer(data=df, mapping=aes(x=ind, y=dep), geom="point") "Error: Attempted to create layer with no stat." 

ggplot2 itself is not broken, since

syntax 2:

 ggplot(df, aes(x=ind, y=dep)) + geom_point() 

creates the expected schedule. Syntax 1 still produces the expected schedule on the old machine (R 2.15.3 OSX 10.5.8). Also, I only used it this morning before the R update. I uninstalled and rebooted R3.2.3, ggplot2 and dependents, but the problem persists. I like Syntax 1 because I like adding layers from different datasets. I would be grateful for the thoughts.

+7
r plot ggplot2 macos
source share
1 answer

Basically it works great when we apply stat = "identity", position_dodge (width = 3) in the function layer

 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)) 

enter image description here

0
source share

All Articles