R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("RColorBrewer-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('RColorBrewer') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "ColorBrewer" > > ### * ColorBrewer > > flush(stderr()); flush(stdout()) > > ### Name: ColorBrewer > ### Title: ColorBrewer palettes > ### Aliases: brewer.pal display.brewer.pal display.brewer.all > ### brewer.pal.info > ### Keywords: color > > ### ** Examples > > ## create a sequential palette for usage and show colors > mypalette<-brewer.pal(7,"Greens") > image(1:7,1,as.matrix(1:7),col=mypalette,xlab="Greens (sequential)", + ylab="",xaxt="n",yaxt="n",bty="n") > Sys.sleep(2) > ## display a divergent palette > display.brewer.pal(7,"BrBG") > Sys.sleep(2) > ## display a qualitative palette > display.brewer.pal(7,"Accent") > Sys.sleep(2) > ## display a palettes simultanoeusly > display.brewer.all(n=10, exact.n=FALSE) > Sys.sleep(2) > display.brewer.all(n=10) > Sys.sleep(2) > display.brewer.all() > Sys.sleep(2) > display.brewer.all(type="div") > Sys.sleep(2) > display.brewer.all(type="seq") > Sys.sleep(2) > display.brewer.all(type="qual") > Sys.sleep(2) > display.brewer.all(n=5,type="div",exact.n=TRUE) > Sys.sleep(2) > brewer.pal.info maxcolors category BrBG 11 div PiYG 11 div PRGn 11 div PuOr 11 div RdBu 11 div RdGy 11 div RdYlBu 11 div RdYlGn 11 div Spectral 11 div Accent 8 qual Dark2 8 qual Paired 12 qual Pastel1 9 qual Pastel2 8 qual Set1 9 qual Set2 8 qual Set3 12 qual Blues 9 seq BuGn 9 seq BuPu 9 seq GnBu 9 seq Greens 9 seq Greys 9 seq Oranges 9 seq OrRd 9 seq PuBu 9 seq PuBuGn 9 seq PuRd 9 seq Purples 9 seq RdPu 9 seq Reds 9 seq YlGn 9 seq YlGnBu 9 seq YlOrBr 9 seq YlOrRd 9 seq > brewer.pal.info["Blues",] maxcolors category Blues 9 seq > brewer.pal.info["Blues",]$maxcolors [1] 9 > > > > ### *