View source: R/sprinkle_bg_pattern.R
sprinkle_bg_pattern | R Documentation |
Provides background color striping based on row or column. Striping may be done with any number of colors. The most common use of striping is to provide row discrimination in tables.
sprinkle_bg_pattern(
x,
rows = NULL,
cols = NULL,
bg_pattern = c("transparent", "#DCDCDC"),
bg_pattern_by = c("rows", "cols"),
...,
part = c("body", "head", "foot", "interoot", "table")
)
## Default S3 method:
sprinkle_bg_pattern(
x,
rows = NULL,
cols = NULL,
bg_pattern = c("transparent", "#DCDCDC"),
bg_pattern_by = c("rows", "cols"),
...,
part = c("body", "head", "foot", "interfoot", "table")
)
## S3 method for class 'dust_list'
sprinkle_bg_pattern(
x,
rows = NULL,
cols = NULL,
bg_pattern = c("transparent", "#DCDCDC"),
bg_pattern_by = c("rows", "cols"),
...,
part = c("body", "head", "foot", "interfoot", "table")
)
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. |
bg_pattern |
A character vector giving the colors to be iterated in the pattern. |
bg_pattern_by |
A subset of |
... |
Additional arguments to pass to other methods. Currently ignored. |
part |
A character string denoting which part of the table to modify. |
Correctly reassigns the appropriate elements bg
column
in the table part.
Casts an error if x
is not a dust
object.
Casts an error if bg_pattern
is not a character vector.
Casts an error if any element in bg_pattern
is not a valid
color name.
Casts an error if bg_pattern_by
is not a subset of
c("rows", "columns")
(with partial matching).
Casts an error if part
is not one of "body"
,
"head"
, "foot"
, or "interfoot"
This is a rare sprinkle that doesn't use the fixed
and recycle
arguments. They are assumed to be FALSE
and "none"
,
respectively, in order to pass through index_to_sprinkle
.
sprinkle_bg
, sprinkle
,
index_to_sprinkle
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.