Description Usage Arguments Details Value See Also Examples
colmat
Plot color matrix for factors/categorical data.
1 2 3 |
x |
A matrix with samples by rows and variables by columns. See details. |
colframe |
Logical. Is the dataset already in colors? Default: FALSE |
transpose |
Logical. Transpose matrix? Default: TRUE |
rowLab |
Logical. Label rows? Default: TRUE |
colLab |
Logical. Label columns? Default: TRUE. Printed above plot. |
pal |
Palette used for when |
lcol |
Line color. Default: 'black' |
rowLine |
|
colLine |
|
las |
|
colSize |
Size parameter for column labels. See details. |
Input can either be a matrix where rows are samples and columns
are variables of factors or colors. For a matrix of factors, define
colFrame = FALSE
, makecolors
with palette pal
is
used to color the matrix. If colFrame = TRUE
, the colors are
plotted verbatim.
rowLine
and colLine
are line
arguments for y-lab
and x-lab respectively. See par
. colSize
is the cex.axis
argument for x-lab.
Plot of a colored table.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Factor variables
x1 <- matrix(sample(c('Positive','Negative'),50,replace = TRUE),25,2,
dimnames = list(paste('Sample',1:25,sep='_'),
c('Mutation_1','Mutation_2')))
x2 <- sample(c('Papillary','Medullary','Mucinous'),25,replace = TRUE)
x <- cbind(x1,Type = x2); rm(x1,x2)
colmat(x)
# Color variables
x <- matrix(sample(c('skyblue3' , 'tan3'), 75, replace = TRUE), 25, 3,
dimnames = list(paste('Sample',1:25,sep='_'),
c('Var1','Var2','Var3')))
colmat(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.