knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "figure/", fig.height = 2 )
haR macht Rwachsene froh!
A fruity yummy plot is what you want? Then haR is the right thing!
Install the package by typing
devtools::install_github("federicomarini/haR")
Load the library and see the available palette with
library(haR) # See all palettes names(har_palettes)
The har_palette
command returns a vector of colors, and has its own print method to display the palette generated
har_palette("goldbears") # usage example cols <- har_palette("goldbears") # and then use cols where you normally require a col parameter
library(ggplot2) ggplot(iris, aes(Sepal.Length, Sepal.Width, color = cut(iris$Sepal.Length,6))) + geom_point(size = 3) + scale_color_manual(values = har_palette("goldbears")) + theme_gray()
har_palette("goldbearsUS")
har_palette("picoballa")
har_palette("konfekt")
har_palette("baerchenpaerchen")
har_palette("tropifrutti")
If you require more colors than what the palette can deliver, use type="continuous"
to interpolate on the selected palette
har_palette("konfekt",n=12,type="continuous")
har_palette("baerchenpaerchen",n=16,type="continuous")
Wanna try some candies but you don't know which one is your favorite?
# do not provide any value to the name parameter and let fate choose for you! # ok, here I kind of manipulate destiny with set.seed set.seed(42) har_palette()
Want more? Please send an email to marinif@uni-mainz.de, and I'll brew you a new palette with the wished candies - or send a pull request if you did the job already!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.