Barplot for penguin species group by island, stratified and stacked by sex.
R code:
library("tinyplot")
data("penguins", package = "palmerpenguins")
pal <- c("darkorange", "purple", "cyan4")
tinytheme("minimal", las = 1, palette.qualitative = pal)
tinyplot(~ island | sex + species, facet = ~ species, data = penguins,
type = "barplot", flip = TRUE, facet.args = list(ncol = 1),
col = "transparent", bg = rbind(pal, colorspace::lighten(pal, 0.6)))
๐จ The #tinyplot pkg for #rstats #dataviz now also has support for barplots (in the R-universe version).
Grouping and faceting can be done using tinyplot's formula-based syntax.
Example: Frequencies of penguin species by island, stacked by sex. (Code in alt text).
grantmcdermott.com/tinyplot/