LMK_colramp: Color Ramp

Description Usage Arguments Details Value Author(s) Examples

View source: R/package-support.R

Description

Create a color ramp based on a grouping factor

Usage

1
LMK_colramp(grp, mute = TRUE)

Arguments

grp

A grouping variable, should be a factor

mute

Logical, should color be muted. If true (default), color values will be generated with saturation value of .4, if false, values will have full saturation (1.0)

Details

Creates color ramp for a given factor and returns a vector of color assignments for each individual using grDevices::rainbow(). Useful for plotting by group.

Value

Returns a vector of color assignments for each individual based on a grouping factor.

Author(s)

Daniel Ehrlich

Examples

1
2
3
data <- cbind(1:20, 20:1)
grps <- as.factor(rep(c("A","B","C","D","E"),4)) 
plot(data, col = LMK_colramp(grps), pch = 16) ##convert factor to rainbow pallete

ehrlichd/lmkCHK documentation built on Sept. 30, 2020, 3:06 a.m.