View source: R/tableColorRamp.R
tableColorRamp | R Documentation |
Makes a table with cells colored by relative rank (e.g. blue to red)
tableColorRamp( data, colorRamp = colorRamps::blue2red, nColors = 20, pdfOut = c("c:\\temp\\test.pdf", NA)[1], pdfHeight = 8, pdfWidth = 11, plotMar = c(8, 8, 8, 10), plotMain = "Table Of Values", legendPrecision = 0, addStat = c(NA, median, mean, sum)[1], statText = "-MEDIAN-", statLine = 2, ... )
data |
data frame of input values to plto |
colorRamp |
color ramp function, e.g. colorRamps package or grDevices::colorRampPalette(c("blue", "red")) |
nColors |
integer number of colors |
pdfOut |
optional output pdf file, NA will result in plotting the R interface |
pdfHeight |
width of output pdf |
pdfWidth |
height of output pdf |
plotMar |
plot margins |
plotMain |
main argument to image function |
legendPrecision |
decimal precision to use for legend object |
... |
additional arguments to image function |
Uses the image function to make a table of colors and writes input data values to color cells
This program is free software but it is provided WITHOUT WARRANTY and with ABSOLUTELY NO GUARANTEE of fitness or functionality for any purpose; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Revision History
1.0 | 6/28/2020 Created and added to package |
NULL - makes a plot or writes plot to pdf file
Jacob Strunk <Jacob.strunk@usda.gov>
image
test = data.frame(matrix(rnorm(100)*100,nrow = 10)) tableColorRamp(test)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.