colChoose | R Documentation |
longCatPlot
Internal function used by longCatPlot
to select color schemes
based on the specified parameters.
colChoose(colScheme, nfactors, reverse = FALSE)
colScheme |
A character string specifying the color scheme to use. Options include:
Although no default is specified, |
nfactors |
The number of unique factors (levels) in the data. This parameter helps determine the number of colors needed. |
reverse |
Logical indicating whether the color scheme should be applied
in reverse order. Default is |
Returns a vector of colors based on the specified color scheme, number of factors, and whether the order is reversed.
Stephen J. Tueller
Tueller, S. J., Van Dorn, R. A., & Bobashev, G. V. (2016). Visualization of categorical longitudinal and times series data (Report No. MR-0033-1602). Research Triangle Park, NC: RTI Press. http://www.rti.org/publication/visualization-categorical-longitudinal-and-times-series-data
longCatPlot
for how this function is used within plotting.
# Example usage within longCatPlot
times <- c(1,100,200,300,400,500,600)
f3lc <- longCat(example3, times, Labels=rep('',5))
longCatPlot(f3lc, main='colScheme=gray', colScheme='gray', lwd=.1, ylab='',
legendBuffer = .25)
# More examples showing different color schemes
par(mfrow=c(2,3), bg='wheat')
longCatPlot(f3lc, main='colScheme=rainbow', colScheme='rainbow', lwd=.1,
ylab='', legendBuffer = .25)
longCatPlot(f3lc, main='colScheme=heat', colScheme='heat', lwd=.1, ylab='',
legendBuffer = .25)
par(mfrow=c(1,1), bg='transparent')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.