Created
April 16, 2020 20:47
-
-
Save alex-ketch/4391125dbbd481dda7c6eb32784f4f00 to your computer and use it in GitHub Desktop.
Stencila tutorial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
# Order by highway MPG | |
mpg$class = with( | |
mpg, | |
reorder(class, hwy, median) | |
) | |
ggplot(mpg, aes( | |
x=class, | |
y=hwy, | |
# Use vehicle class for color | |
fill = class | |
)) + | |
geom_violin() + | |
theme(legend.position="none") + | |
xlab("Vehicle class") + | |
ylab("Highway MPG") |
Author
alex-ketch
commented
May 26, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment