1

Using code taken directly from documentation page (http://www.sthda.com/english/wiki/ggplot2-barplot-easy-bar-graphs-in-r-software-using-ggplot2#faceting-split-a-plot-into-a-matrix-of-pannels) R will not recognize documented parameters:

ggplot2.barplot(data=diamonds, xName="clarity", + faceting=TRUE, facetingVarNames="cut") Error: Unknown parameters: faceting, facetingVarNames**

  • 1
    (1) That is not the official documentation page, [this is](http://docs.ggplot2.org/current/index.html). (2) Did you load the `easyGgplot2` package as is instructed at the top of that webpage? – Jaap Dec 22 '15 at 11:11
  • Furthermore: You might want to read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610). This will make it much easier for others to help you. – Jaap Dec 22 '15 at 11:12
  • Also be aware that ggplot2 has very recently been updated [blog post](http://blog.rstudio.org/2015/12/21/ggplot2-2-0-0/) and online documentation may not be up to date. Check the version you are loading. – r.bot Dec 22 '15 at 11:17

2 Answers2

3

As shown in the image below, I didn't get any error:

enter image description here

I would suggest to re-install easyGgplot2 package and to try it again:

 # Install
 install_github("kassambara/easyGgplot2")

 # Load easyGgplot2
 library(easyGgplot2)

 data(diamonds)

 ggplot2.barplot(data=diamonds, xName="clarity",  faceting=TRUE, facetingVarNames="cut")

Have a nice day!!

Best Regards, AK

A. Kassambara
  • 228
  • 1
  • 5
2

This is how I would reproduce the first figure in the link given, without installing easyGgplot2, using ggplot2v2.0.0.

require(ggplot2)
data("diamonds")
p <- ggplot(diamonds, aes(x = clarity)) + 
  geom_bar() + facet_grid(cut ~ .)
p

diamond plot

r.bot
  • 5,309
  • 1
  • 34
  • 45