I am trying to learn ggplot with facet. here is the codes works in Rstudio
p <- ggplot(mtcars, aes(mpg, wt)) + geom_point()
# With one variable
p + facet_grid(. ~ cyl)
however, it shows error for ncol after I added ncol=2 :
p + facet_grid( ~ cyl,ncol=2)
Error in facet_grid(~cyl, ncol = 2) : unused argument (ncol = 2)