Skip to content

Instantly share code, notes, and snippets.

@johndhancock
Last active April 13, 2023 14:35
Show Gist options
  • Save johndhancock/21f2bba3d4f5a9be364d853d760d4049 to your computer and use it in GitHub Desktop.
Save johndhancock/21f2bba3d4f5a9be364d853d760d4049 to your computer and use it in GitHub Desktop.
A collection of handy tips and tricks for R

ggplot

Tip Sheet

Color palettes

Saving custom color palettes to a variable, then using them in a ggplot chart

saving the palette

palette <- c(‘#d2848c”, “#fa807s”, “#ee9a00”, “#e0ffff”)

using it in a chart

barplot(<data>, col = palette)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment