demo/demo_fns.R

require(RColorBrewer)

colour_var <- function(var, cols=NULL){
	var <- as.factor(var)
	n <- max(3,length(levels(var)))
	if (is.null(cols))
	 # cols <- rainbow(n,alpha=0.5,s=.5)
	   cols <- brewer.pal(n,"Set2")
     return(cols[as.numeric(var)])
	
	}

Try the PairViz package in your browser

Any scripts or data that you put into this service are public.

PairViz documentation built on Aug. 12, 2022, 5:06 p.m.