| sprinkle_font {pixiedust} | R Documentation |
Sprinkle the Characteristics of Text in a Cell
Description
Text can be made to stand out (or fade away) by using font features such as bold and italic text, color, size, or different fonts.
Usage
sprinkle_font(
x,
rows = NULL,
cols = NULL,
bold = NULL,
italic = NULL,
font_size = NULL,
font_size_units = NULL,
font_color = NULL,
font_family = NULL,
...,
part = c("body", "head", "foot", "interfoot", "table"),
fixed = FALSE,
recycle = "none"
)
## Default S3 method:
sprinkle_font(
x,
rows = NULL,
cols = NULL,
bold = NULL,
italic = NULL,
font_size = NULL,
font_size_units = NULL,
font_color = NULL,
font_family = NULL,
...,
part = c("body", "head", "foot", "interfoot", "table"),
fixed = FALSE,
recycle = "none"
)
## S3 method for class 'dust_list'
sprinkle_font(
x,
rows = NULL,
cols = NULL,
bold = NULL,
italic = NULL,
font_size = NULL,
font_size_units = NULL,
font_color = NULL,
font_family = NULL,
...,
part = c("body", "head", "foot", "interfoot", "table"),
fixed = FALSE,
recycle = "none"
)
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. |
bold |
|
italic |
|
font_size |
|
font_size_units |
|
font_color |
|
font_family |
|
... |
Additional arguments to pass to other methods. Currently ignored. |
part |
A character string denoting which part of the table to modify. |
fixed |
|
recycle |
A |
Details
The bold and italic features are recognized by all
formats.
Font size features are recognized by HTML and LaTeX. LaTeX only recognizes
the font size unit options of "pt" and "em", but will quietly
change "px" to "pt" when printing.
Font color features are recognized by HTML and LaTeX.
Font family is only recognized by HTML.
Functional Requirements
Correctly change the
boldcolumn of the table part for the selected cells.Correctly change the
italiccolumn of the table part for the selected cells.Correctly change the
font_sizecolumn of the table part for the selected cells.Correctly change the
font_size_unitscolumn of the table part for the selected cells.Correctly chagne the
font_colorcolumn of the table part for the selected cells.Correctly change the
font_familycolumn of the table part for the selected cells.Cast an error if
xis not a dust object.Cast an error if
boldis notlogical(1)Cast an error if
italicis notlogical(1)Cast an error if
font_sizeis notnumeric(1)Cast an error if
font_size_unitsis notcharacter(1)Cast an error if
font_size_unitsis not one of px, pt, em, orCast an error if
font_coloris notcharacter(1)Cast an error if
font_familyis notcharacter(1)Cast an error if
partis not a subset ofc("body", "head", "foot", "interfoot")Cast an error if
recycle = "none"andbolddoes not have length 1.Cast an error if
recycle = "none"anditalicdoes not have length 1.Cast an error if
recycle = "none"andfont_sizedoes not have length 1.Cast an error if
recycle = "none"andfont_size_unitsdoes not have length 1.Cast an error if
recycle = "none"andfont_colordoes not have length 1.Cast an error if
recycle = "none"andfont_familydoes not have length 1.
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.
Author(s)
Benjamin Nutter