tableColorRamp: Makes a table with cells colored by relative rank (e.g. blue...

View source: R/tableColorRamp.R

tableColorRampR Documentation

Makes a table with cells colored by relative rank (e.g. blue to red)

Description

Makes a table with cells colored by relative rank (e.g. blue to red)

Usage

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,
  ...
)

Arguments

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

Details

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

Value

NULL - makes a plot or writes plot to pdf file

Author(s)

Jacob Strunk <Jacob.strunk@usda.gov>

See Also

image

Examples

   test = data.frame(matrix(rnorm(100)*100,nrow = 10))
   tableColorRamp(test)



jstrunk001/RSForInvt documentation built on April 18, 2022, 11:03 p.m.