| sprinkle_gradient {pixiedust} | R Documentation |
Change Color Features by Binning Numeric Values
Description
Numeric values within a range of cells are binned and colors assigned to show gradual increases in the numeric value.
Usage
sprinkle_gradient(
x,
rows = NULL,
cols = NULL,
gradient = "bg",
gradient_colors = getOption("pixie_gradient_pal", NULL),
gradient_cut = NULL,
gradient_n = 10,
gradient_na = "grey",
part = c("body", "head", "foot", "interfoot", "table"),
fixed = FALSE,
recycle = c("none", "rows", "cols", "columns"),
...
)
## Default S3 method:
sprinkle_gradient(
x,
rows = NULL,
cols = NULL,
gradient = "bg",
gradient_colors = getOption("pixie_gradient_pal", c("#132B43", "#56B1F7")),
gradient_cut = NULL,
gradient_n = 10,
gradient_na = "grey",
part = c("body", "head", "foot", "interfoot", "table"),
fixed = FALSE,
recycle = c("none", "rows", "cols", "columns"),
...
)
## S3 method for class 'dust_list'
sprinkle_gradient(
x,
rows = NULL,
cols = NULL,
gradient = "bg",
gradient_colors = getOption("pixie_gradient_pal", c("#132B43", "#56B1F7")),
gradient_cut = NULL,
gradient_n = 10,
gradient_na = "grey",
part = c("body", "head", "foot", "interfoot", "table"),
fixed = FALSE,
recycle = c("none", "rows", "cols", "columns"),
...
)
Arguments
x |
An object of class |
rows |
Either a numeric vector of rows in the tabular object to be
modified or an object of class |
cols |
Either a numeric vector of columns in the tabular object to be modified, or a character vector of column names. A mixture of character and numeric indices is permissible. |
gradient |
|
gradient_colors |
|
gradient_cut |
|
gradient_n |
|
gradient_na |
|
part |
A character string denoting which part of the table to modify. |
fixed |
|
recycle |
A |
... |
Additional arguments to pass to other methods. Currently ignored. |
Details
This sprinkle is only recognized by HTML and LaTeX. All of the
height_units values are recognized by HTML. For LaTeX, "px"
is converted to "pt".
"font" and "font_color" both change the font color.
"border" is a shortcut to specify all borders.
Functional Requirements
Correctly reassigns the appropriate elements of the
bg,font_color,left_border,top_border,right_border, orbottom_bordercolumn in the table part.Casts an error if
xis not adustobject.Casts an error if
gradientis not a subset ofc("bg", "font", "font_color", "border", "left_border", "right_border", "top_border", "bottom_border")Casts an error if
gradient_colorsis not acharacter(2)value.Casts an error if any value of
gradient_colorsis not a recognized color value.Casts an error if
gradient_cutis notnumeric.Casts an error if
gradient_nis notnumeric(1).Casts an error if
gradient_nais notcharacter(1).Casts an error if
gradient_nais not a valid color.Casts an error if
partis not one of"body","head","foot", or"interfoot"Casts an error if
fixedis not alogical(1)Casts an error if
recycleis not one of"none","rows", or"cols"
The functional behavior of the fixed and recycle arguments
is not tested for this function. It is tested and validated in the
tests for index_to_sprinkle.