dust table are added by "sprinkling"
with a little extra fairy dust. Sprinkles are a collection of attributes
to be applied over a subset of table cells. They may be added to any
part of the table, or to the table as a whole.sprinkle(rows = NULL, cols = NULL, ..., part = c("body", "head", "foot",
"interfoot", "table"))sprinkle_print_method(print_method = c("console", "markdown", "html",
"latex"))
... dots argument. All sprinkles may be defined for any output type, but
only sprinkles recognized by that output type will be applied. For a complete
list of which sprinkles are recognized by each output type, see
vignette("sprinkles", package = "pixiedust").bgbg_patternbg_pattern_by is
specified, this will default to c("white", "gainsboro").}
bg_pattern_by"rows",
or "columns" with partial matching and defaults to "rows".
If bg_pattern is provided, bg_pattern_by is assumed, meaning
it is not necessary to explicitly define bg_pattern_by unless
changing an existing or default setting.}
boldTRUE, text is rendered in bold.}
border_collapseTRUE.
This element is only applicable to
part = "table" and will be applied to the table regardless
the value of part in the call.}
border"left", "right", "top",
"bottom", and "all" with partial matching. The border will be added
to the sides indicated.}
border_thickness1.}
border_units"px" or "pt" with partial matching. Defaults
to "px".}
border_style"solid", "dashed", "dotted",
"double", "groove", "ridge", "inset",
"outset", "hidden", or "none". Defaults
to "solid".}
border_colorfnvalue. For
example, quote(round(value, 3)).}
font_colorfont_sizefont_size_units"px", "pt", "%",
and "em". Defaults to "px".}
halign"left", "center", or
"right", with partial matching.}
heightheight_unitsheight argument. Accepts "px" and "%". Defaults
to "px".}
italicTRUE, text is rendered in italics.}
padrotate_degreeroundfn argument, but this argument makes it a bit easier to do.}
valign"top", "middle", or "bottom"
with partial matching.}
widthwidth_unitswidth argument. Accepts "px" and "%". Defaults
to "px".}"orchid"),
hexidecimal names ("#DA70D6"), rgb names ("rgb(218 112 214)"),
and rgba (rgb+alpha transparancy; "rgba(218, 112, 214, .75)").
Refer to part. Whenever part = "table", rows and columns are ignored
and the attributes are applied to the entire table.
If at least one of border, border_thickness, border_units,
border_style or border_color is specified, the remaining
unspecified attributes assume their default values.
The sprinkles `bg` and `bg_pattern` may not be used together.
A more detailed demonstration of the use of sprinkles is available in
vignette("pixiedust", package = "pixiedust")
sprinkle_colnames for changing column names in a table.x <- dust(lm(mpg ~ qsec + factor(am), data = mtcars))
x + sprinkle(cols = 2:4, round = 3) +
sprinkle(cols = 5, fn = quote(pvalString(value))) +
sprinkle(rows = 2, bold = TRUE)Run the code above in your browser using DataLab