Only one edge facet_grid
I would like to use a facet grid to only display the right margin and not the bottom margin.
Sample code
library(ggplot2)
qplot(mpg, wt, data=mtcars) + facet_grid(cyl ~ vs, margins=TRUE)
Current result
Desired result
+3
Tyler rinker
source
to share
1 answer
qplot(mpg, wt, data=mtcars) + facet_grid(cyl ~ vs, margins="vs")
When this answer was written, this behavior was not documented. It is now in the facet_grid documentation
fields are either a boolean value or a character character. Fields are additional faces that contain all data for each of the possible values โโof the cut variables. If
FALSE
, additional faces are not included (default). IfTRUE
, fields are included for all faceted variables. If specified as a character vector, these are the variable names for which you want to create fields.
(Thanks @Harry for that.)
+4
Brian diggs
source
to share