purrr family of functions helps us replace for loops, making our code easier to read and more succint.
Ok, we love our earlier boxplot showing us body_mass_g by sex and colored by species…
…but let’s change up the colors to keep with our Antarctica theme!
I’m a big fan of the color palettes in the
Let’s turn this plot…
…into this one!
Note: The color choices in this example are meant for demo purposes only. Be sure to consider the accessibility of your data viz, including color contrast between different elements.
You can choose colors using
the color hex codes
And assign them using the
You can also use the palette name, like mountain_forms, though the colors assigned may not align with what you want
prismatic 📦 helps us see the colors that correspond to each color hex code (mostly), with the
🎨 r-color-palettes repo from Emil Hvitfeldt
Like this Wes Anderson themed one! And many, many others 🤩