sprinkle_border {pixiedust} | R Documentation |
Sprinkle Changes to Cell Borders
Description
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.
Usage
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"),
...
)
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. |
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. |
Details
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.
Functional Requirements
Correctly reassigns the
left_border
,right_border
,top_border
andbottom_border
columns in the table part.Casts an error if
x
is not adust
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 acharacter(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 anumeric(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 alogical(1)
Casts an error if
recycle
is not one of"none"
,"rows"
, or"cols"
Cast an error if
recycle = "none"
andborder_color
does not have length 1.Cast an error if
recycle = "none"
andborder_style
does not have length 1.Cast an error if
recycle = "none"
andborder_thickness
does not have length 1.Quietly restrict
border_units
to just the first element if is has length > 1 andrecycle = "none"
.
Author(s)
Benjamin Nutter