View source: R/sprinkle_font.R
| sprinkle_font | R Documentation |
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.
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"
)
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 |
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.
Correctly change the bold column of the table part for
the selected cells.
Correctly change the italic column of the table part for
the selected cells.
Correctly change the font_size column of the table part for
the selected cells.
Correctly change the font_size_units column of the table part for
the selected cells.
Correctly chagne the font_color column of the table part
for the selected cells.
Correctly change the font_family column of the table part for
the selected cells.
Cast an error if x is not a dust object.
Cast an error if bold is not logical(1)
Cast an error if italic is not logical(1)
Cast an error if font_size is not numeric(1)
Cast an error if font_size_units is not character(1)
Cast an error if font_size_units is not one of
px, pt, em, or
Cast an error if font_color is not character(1)
Cast an error if font_family is not character(1)
Cast an error if part is not a subset of c("body",
"head", "foot", "interfoot")
Cast an error if recycle = "none" and bold
does not have length 1.
Cast an error if recycle = "none" and italic
does not have length 1.
Cast an error if recycle = "none" and font_size
does not have length 1.
Cast an error if recycle = "none" and font_size_units
does not have length 1.
Cast an error if recycle = "none" and font_color
does not have length 1.
Cast an error if recycle = "none" and font_family
does 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.
Benjamin Nutter
sprinkle
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.