View source: R/general.purpuse.utilities.R
imageWithText | R Documentation |
Wraps image functions
imageWithText(
d,
t = NULL,
digits = 2,
text.col = NULL,
xaxlab = rownames(d),
yaxlab = colnames(d),
centerColors0 = FALSE,
las = 2,
text.xadj = 0.5,
colAnns = NULL,
rowAnns = NULL,
colAnnCols = NULL,
rowAnnCols = NULL,
col = hcl.colors(100, "YlOrRd", rev = TRUE),
rowAnnWidth = 0.7,
colAnnWidth = 0.7,
annSpacer = 0.1,
...
)
d |
matrix to be plotted |
t |
text to be ploted on top of image (rounds d by default) |
digits |
number of digits retained under rounding of d |
text.col |
color for text |
xaxlab , yaxlab |
axis labels, dimnames(d) by default |
centerColors0 |
logical, specifies whether 0 should be considered as palette center (makes sense for correlation matrices) |
las |
orientation of axis labels (see las in ?par) |
text.xadj |
text adjastment by x |
colAnns , rowAnns |
list (or matrix of columns) of column (row) annotation to be shown by color |
rowAnnWidth , colAnnWidth |
|
annSpacer |
|
... |
other options to be supplied to image |
colAnnsCols , rowAnnsCols |
|
legend.cex.at , legend.col.at |
values to be used in legend, set both to have two independent legends for size and colour |
legend.cex.title , legend.col.title |
titles of legends |
par(mar=c(10,6,1,1),bty='n')
imageWithText(mtcars[1:4,1:3],rowAnns=list(r1=c(1,1,2),r2=c('a','a','a')),rowAnnCols=list(r1=c('1'='red','2'='blue'),r2=c(a='green')),colAnns = list(c1=c(1,1,1,2),c2=c(2,1,2,1),c3=c('a','b','b','b')))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.