Internal Function for Selecting Color Schemes Used by longCatPlot
Internal function used by longCatPlot
.
colChoose(colScheme, nfactors, reverse = FALSE)
colScheme |
can be one of
No default is given in the function definition, but the default in |
nfactors |
see |
reverse |
logical - should color scheme be applied in reverse order to the levels of the categorical variable? Default is |
Stephen 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
# color examples par(mfrow=c(2,3), bg='wheat') 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) longCatPlot(f3lc, main='colScheme=rainbow', colScheme='rainbow', lwd=.1, ylab='', legendBuffer = .25) longCatPlot(f3lc, main='colScheme=heat', colScheme='heat', lwd=.1, ylab='', legendBuffer = .25) longCatPlot(f3lc, main='colScheme=terrain', colScheme='terrain', lwd=.1, ylab='', legendBuffer = .25) longCatPlot(f3lc, main='colScheme=topo', colScheme='topo', lwd=.1, ylab='', legendBuffer = .25) longCatPlot(f3lc, main='colScheme=cm', colScheme='cm', lwd=.1, ylab='', legendBuffer = .25) par(mfrow=c(1,1), bg='transparent') ## Not run: # illustrate the use of colors from the package RColorBrewer library(RColorBrewer) par(mfrow=c(2,3), bg='cornsilk3') longCatPlot(f3lc, main='RColorBrewer: Blues', cols=brewer.pal(f3lc$nfactors, "Blues"), lwd=.1, ylab='', legendBuffer = .25) longCatPlot(f3lc, main='RColorBrewer: Greens', cols=brewer.pal(f3lc$nfactors, "Greens"), lwd=.1, ylab='', legendBuffer = .25) longCatPlot(f3lc, main='RColorBrewer: PuBuGn', cols=brewer.pal(f3lc$nfactors, "PuBuGn"), lwd=.1, ylab='', legendBuffer = .25) longCatPlot(f3lc, main='RColorBrewer: YlOrRd', cols=brewer.pal(f3lc$nfactors, "YlOrRd"), lwd=.1, ylab='', legendBuffer = .25) longCatPlot(f3lc, main='RColorBrewer: Spectral', cols=brewer.pal(f3lc$nfactors, "Spectral"), lwd=.1, ylab='', legendBuffer = .25) longCatPlot(f3lc, main='RColorBrewer: Accent', cols=brewer.pal(f3lc$nfactors, "Accent"), lwd=.1, ylab='', legendBuffer = .25) par(mfrow=c(1,1), bg='transparent') # illustrate the use of colors from the package colorspace library(colorspace) par(mfrow=c(2,3), bg='cornsilk3') longCatPlot(f3lc, main='colorspace: rainbow_hcl', cols=rainbow_hcl(f3lc$nfactors), lwd=.1, ylab='', legendBuffer = .25) longCatPlot(f3lc, main='colorspace: sequential_hcl', cols=sequential_hcl(f3lc$nfactors), lwd=.1, ylab='', legendBuffer = .25) longCatPlot(f3lc, main='colorspace: heat_hcl', cols=heat_hcl(f3lc$nfactors), lwd=.1, ylab='', legendBuffer = .25) longCatPlot(f3lc, main='colorspace: terrain_hcl', cols=terrain_hcl(f3lc$nfactors), lwd=.1, ylab='', legendBuffer = .25) longCatPlot(f3lc, main='colorspace: diverge_hcl', cols=diverge_hcl(f3lc$nfactors), lwd=.1, ylab='', legendBuffer = .25) longCatPlot(f3lc, main='colorspace: diverge_hsv', cols=diverge_hsv(f3lc$nfactors), lwd=.1, ylab='', legendBuffer = .25) par(mfrow=c(1,1), bg='transparent') ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.