View source: R/sprinkle_border.R
| sprinkle_border | R Documentation |
Cell borders may be used to give visual structure to a table. Borders may generate distinction between sets of results, groups, or types of output.
sprinkle_border(
x,
rows,
cols,
border = c("all", "bottom", "left", "top", "right"),
border_color = "black",
border_style = "solid",
border_thickness = 1,
border_units = c("pt", "px"),
part = c("body", "head", "foot", "interfoot", "table"),
fixed = FALSE,
recycle = c("none", "rows", "cols", "columns"),
...
)
## Default S3 method:
sprinkle_border(
x,
rows = NULL,
cols = NULL,
border = c("all", "bottom", "left", "top", "right"),
border_color = "black",
border_style = "solid",
border_thickness = 1,
border_units = c("pt", "px"),
part = c("body", "head", "foot", "interfoot", "table"),
fixed = FALSE,
recycle = c("none", "rows", "cols", "columns"),
...
)
## S3 method for class 'dust_list'
sprinkle_border(
x,
rows = NULL,
cols = NULL,
border = c("all", "bottom", "left", "top", "right"),
border_color = "black",
border_style = "solid",
border_thickness = 1,
border_units = c("pt", "px"),
part = c("body", "head", "foot", "interfoot", "table"),
fixed = FALSE,
recycle = c("none", "rows", "cols", "columns"),
...
)
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. |
border |
One or more of |
border_color |
|
border_style |
|
border_thickness |
|
border_units |
|
part |
A character string denoting which part of the table to modify. |
fixed |
|
recycle |
A |
... |
Additional arguments to pass to other methods. Currently ignored. |
This sprinkle has no effect on console and markdown output.
HTML output accepts all of the possible values of border_style.
For LaTeX output, when hhline = FALSE, "solid", "dashed",
"dotted", "hidden", and "none" are accepted.
"dotted" will silently be treated as "dashed", and
"hidden" is the equivalent of "none".
For LaTeX output when hhline = TRUE, "solid", "double",
"hidden", and "none" are accepted. "hidden" is the
equivalent of "none".
When a value of border_style is not recognized by an output format,
it is silently ignored.
Correctly reassigns the left_border, right_border,
top_border and bottom_border columns in the table part.
Casts an error if x is not a dust object.
Casts an error if any element of border is not one of
"all", "bottom", "left", "top", or
"right".
Casts an error if border_color is not a character(1)
Casts an error if border_color is not a valid color format.
Casts an error if border_style is not one of "solid",
"dashed", "dotted", "double", "groove",
"ridge", "inset", "outset", "hidden",
"none"
Casts an error if border_thickness is not a numeric(1).
Casts an error if border_units is not one of "pt" or
"px".
Casts an error if part is not one of "body",
"head", "foot", or "interfoot"
Casts an error if fixed is not a logical(1)
Casts an error if recycle is not one of "none",
"rows", or "cols"
Cast an error if recycle = "none" and border_color
does not have length 1.
Cast an error if recycle = "none" and border_style
does not have length 1.
Cast an error if recycle = "none" and border_thickness
does not have length 1.
Quietly restrict border_units to just the first element if
is has length > 1 and recycle = "none".
Benjamin Nutter
sprinkle, index_to_sprinkle
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.