Search code examples
rggplot2facetfacet-grid

Unused argument error in facet_grid for switch


I am drawing bar plots in ggplot2 using facet_grid for class divisions. Can any body tell me why am I getting the error of unusued agrument for switch="x", in an attempt to bring the facet labels at the bottom?:

ggplot(d, aes(x=V4, y=V2,group=V1,fill=V1)) + geom_bar(stat ="identity",position="stack") +  facet_grid(.~ V3,scales = "free",space="free",switch="x")

error I get is as follows:

Error in facet_grid(. ~ V3, scales = "free", space = "free", switch = "x") : 
unused argument (switch = "x")

Solution

  • Thanks to the question of @Hugh, upon checking the manual of ggplot2 v1.0.0 I found out that the switch option isn't available as an argument for facet_grid in that version...