View source: R/sprinkle_colnames.R
sprinkle_colnames | R Documentation |
dust
TablesAssigns new column names to a table
sprinkle_colnames(x, ...)
## Default S3 method:
sprinkle_colnames(x, ...)
## S3 method for class 'dust_list'
sprinkle_colnames(x, ...)
x |
A dust object. |
... |
Column names for the table. See 'Input Formats' |
named arguments Using dust_colnames(term = "Term", estimate = "Estimate")
,
column names may be passed for all or a subset of the columns. The existing column
name will be matched against the argument name.
unnamed arguments Using dust_colnames("Term", "Estimate", "SE", ...)
,
column names may be passed for all of the columns. If the arguments are unnamed, the
number of arguments passed must match the number of columns in the table.
When using named arguments (or a named vector), you may not mix named and unnamed elements. In other words, if one element is named, they must all be named. Unnamed elements are assigned to columns in sequential order.
Benjamin Nutter
sprinkle
x <- dust(lm(mpg ~ qsec + factor(am), data = mtcars))
x
x %>% sprinkle_colnames(term = "Term", statistic = "T")
x %>% sprinkle_colnames("Term", "Estimate", "SE", "T-statistic", "p-value")
## Not run:
# Causes an error due to too few unnamed arguments
x %>% sprinkle_colnames("Term", "Estimate")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.