panelet
row, the top row in panelmap
panelet_group.Rd
Given ordered class labels, make a row of colors grouped by the categories of class. This is the first plot in makepanel
. All subsequent panelets should follow this ordering of class labels.
panelet_group(gr, gr.col,gr.name="group",border=FALSE, border.col="black", legend=FALSE, ...)
gr | a vector, of class labels in the form of character or integer |
---|---|
gr.col | a vector of colors specified for each class in |
gr.name | a string, name of your group labels |
border | logical. default is |
border.col | default is |
legend | logical. default is |
... | pass optional arguments here |
...
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.
A colored panelet
ordered by class labels is plotted.
if legend = TRUE
, returns a key mapping the group labels to specific color
makepanel
#adjust margins and number of panelet values par(mfrow=c(6,1),mar=c(0,8,0,14)) #sort the entire data frame according to the group solution you are interested in mtcars.sort = mtcars[order(mtcars$cyl),] #plot group tt=panelet_group(gr=mtcars.sort$cyl, gr.col=c("red","blue","green"), gr.name="cyl",cex=1, border=FALSE, legend=FALSE)