A wrapper function to plot panelmap with one line command, which internally calls panelet_category, panelet_group, and panelet_continuous. One can pass all parameters in one go. For panelet level customization, use without wrapper function

makepanel(gr,gr.name="Group",gr.col,mat,mat.col,mat.type,legend=FALSE,
get.pval=FALSE,NA.flag=FALSE, NA.col="grey",border=FALSE,
border.col="black",lnrow=3,lncol=5,lcex=1,legend.vec=NULL,legend.col=NULL, lheight=1, ...)

Arguments

gr

required. vector. Class or group labels. see panelet_group

gr.name

a string, name for your class or group labels

gr.col

required. a vector of colors specified for each class in gr. Also accepts vector from RcolorBrewer

mat

required. data frame. of values that you want to plot. Make sure they are ordered in the same order as gr vector.

mat.col

required. list. of color values to be coded. names of the list are column names of mat see example below.

mat.type

required. vector. type of data type in mat. 1 = discrete/binary. 2 = continuous .See example below.

NA.flag

logical, default is FALSE. see get.colvector for details

NA.col

default is "grey". see get.colvector for details

get.pval

logical, default is FALSE. Perform non parametric association tests to test for association between the group variable and the continuous variable of interest. If TRUE a table summarizing median value and range in each class is returned as well.

border

logical, default is FALSE. Add a border outside panelet and demarcating group boundaries

border.col

default is "black", if border=TRUE, you can specify the color of the border to be plotted. Plots outside the panelet and class boundaries

legend

logical. default is FALSE. if TRUE plots a legend at bottom right corned specifying each color assigned to the categories.

lnrow

numeric. Number of rows in each panelet of the legend. Adjust to fit in plot margins. Default is 3 rows. See example. Only when legend=TRUE

lncol

numeric. Number of columns on each panelet of the legend. Adjust accordingly for legibility. Default is 5 columns.Only when legend=TRUE

lcex

numeric. Magnification of legend labels. Default value is cex=1. Only when legend=TRUE

legend.vec

vector. When legend=TRUE, all values passed as mat.type=1 are passed to be plotted in the legend. If you want to show less information,pass the legend vector of your choice.

legend.col

vector. When legend=TRUE, all values passed as mat.type=1 are given a color and are plotted in the legend. If you want to show less information, pass the legend vector colors of your choice corresponding to legend.vec.

lheight

numeric. If your legend overflows the current panelmap margins, use this to add more space for legend. Default value is 1.Only when legend=TRUE

...

pass optional arguments here

Details

... can pass other parameters. Use it for controlling names and colors of panelets via cex, col. border line type and thickness can be controlled via lty and lwd respectively.

Value

A colored panelemap of discrete/continuous values is plotted ordered according to the group labels as specified.

See also

makepanel

Examples

#sort everything by cyl mtcars.sort = mtcars[order(mtcars$cyl),] #other features to plot mat = mtcars.sort[,c("mpg","vs","am","gear")] #color assigned to each feature mat.col=list(am=c("white","black"), vs=c("white","black"), gear=c("yellow","orange","brown"), mpg=c("white", "darkred")) #type of each feature. type=1 for discrete and type=2 for continuous. mat.type= c(2,1,1,1) tab=makepanel(gr=mtcars.sort$cyl, gr.name="cyl",gr.col=c("red","blue","green"), mat=mat, mat.col=mat.col, mat.type=mat.type, border=TRUE, legend=TRUE, get.pval=TRUE, cex=1)
#> Performing Kruskal-Wallis test
#> Performing Fisher's Exact test
#> Performing Fisher's Exact test
#> Performing Fisher's Exact test
#example to adjust for legend parameters v1=v5= sample(c(1:3),50, replace=TRUE) v2 = sample(c("aa","bb"),50, replace=TRUE) v3 = v7 = v9 = sample(c(1:4), 50, replace=TRUE) v4 = v6 = v8 = v10 = sample(c(1:6), 50, replace=TRUE) mat = cbind(v2,v3,v4,v5,v6,v7,v8,v9,v10) mat.type = rep(1,9) col4 = c("cyan4", "coral3", "mediumpurple3", "azure3") col6 = c("lightpink3", "lightpink4", "lightsalmon2", "lightsalmon3","lightsalmon4", "mistyrose3") mat.col = list(v2 = c("white", "brown"), v3 = col4, v7 = col4, v9=col4, v4=col6, v6=col6, v8=col6, v10=col6, v5=c("mediumpurple3", "azure3", "lightsalmon4")) v1 = v1[order(v1)] makepanel(v1, "v1", c("red","blue","green"), mat, mat.col, mat.type, legend=TRUE, lnrow=2, lncol=5, lcex=1.2, lheight=4)