Skip to content

Instantly share code, notes, and snippets.

@sahirbhatnagar
Last active April 15, 2016 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sahirbhatnagar/4db246dd767eabb204eead836b29cd44 to your computer and use it in GitHub Desktop.
Save sahirbhatnagar/4db246dd767eabb204eead836b29cd44 to your computer and use it in GitHub Desktop.
### Boxplot of {{k}} by number of cylinders
```{r boxplot-by-cyl-{{j}}, eval=TRUE}
ggplot(mtcars,
aes(x = cyl, y = {{j}},
fill = cyl)) +
geom_boxplot() +
theme_bw() +
theme(legend.position = "bottom") +
xlab("") +
ylab(paste(quote({{j}})))
```
### Boxplot of {{k}} by number of cylinders and transmission
```{r boxplot-by-cyl-am-{{j}}, eval=TRUE}
ggplot(mtcars,
aes(x = cyl, y = {{j}},
fill = cyl)) +
geom_boxplot() +
facet_grid(~am) +
theme_bw() +
theme(legend.position = "bottom") +
xlab("") +
ylab(paste(quote({{j}})))
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment