Last active
June 23, 2020 17:30
-
-
Save chelseaparlett/1964af71317cc0e52e1d803528c7e401 to your computer and use it in GitHub Desktop.
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) | |
library(palmerpenguins) | |
library(MASS) | |
#penguin-------------------------------------------------- | |
penguins <- na.omit(penguins) | |
ggplot(penguins, aes(x = bill_length_mm, bill_depth_mm)) + | |
geom_point() + | |
facet_wrap(sex~species) + | |
theme_bw() + | |
ggtitle("Penguin Bill Length and Depth (facet_wrap)") | |
ggplot(penguins, aes(x = bill_length_mm, bill_depth_mm)) + | |
geom_point() + | |
facet_grid(sex~species) + | |
theme_bw() + | |
ggtitle("Penguin Bill Length and Depth (facet_grid)") | |
#cereal---------------------------------------------------- | |
data("UScereal") | |
ggplot(UScereal, aes(x = fibre, y = sugars)) + | |
geom_point() + | |
facet_wrap(vitamins ~ mfr) + | |
theme_bw() + | |
ggtitle("Cereal Fibre and Sugars (facet_wrap)") | |
ggplot(UScereal, aes(x = fibre, y = sugars)) + | |
geom_point() + | |
facet_grid(vitamins ~ mfr) + | |
theme_bw() + | |
ggtitle("Cereal Fibre and Sugars (facet_grid)") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment