Skip to content

Commit

Permalink
add peng-boxplots.R
Browse files Browse the repository at this point in the history
  • Loading branch information
friendly committed Nov 10, 2023
1 parent 5064ee8 commit 5920954
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions R/penguin/peng-boxplots.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
library(dplyr)
library(tidyr)
library(ggplot2)


load(here::here("data", "peng.RData"))

peng_long <- peng %>%
pivot_longer(bill_length_mm:body_mass_g,
names_to = "characteristic",
values_to = "value")

peng_long %>%
group_by(species) %>%
ggplot(aes(value, species, fill = species)) +
geom_boxplot() +
facet_wrap(~characteristic, scales = 'free_x') +
theme(legend.position = 'none')
# scale_fill_viridis_d()
Binary file removed figs/unnamed-chunk-37-1.png
Binary file not shown.

0 comments on commit 5920954

Please sign in to comment.