README.md

HalPalR

An R package for generating color palettes using Halton sequences in CIE Lab* color space. Based on halpal.py by John Wiedenhoeft.

Installation

To install from GitHub:

require(remotes)
remotes::install_github("benjaminrich/HalPalR")

Examples

library(HalPalR)
library(ggplot2)

n <- 20
barplot(rep(1, n), col=halpal(n), space=0, border=NA, axes=FALSE)


n <- 20
set.seed(123)
intercept <- runif(n, -5, 5)
slope <- -(intercept/5)*runif(n, 0, 1)
dat <- expand.grid(ID=paste0("ID:", 1:n), x=1:10)
dat$y <- intercept + dat$x*slope + runif(nrow(dat), 0, 3)
ggplot(dat, aes(x=x, y=y, color=ID)) + geom_line(size=1) +
  scale_color_halpal() + theme_bw()



benjaminrich/HalPalR documentation built on Dec. 23, 2019, 7:30 p.m.