Learn R Programming

pixiedust (version 0.5.0)

dust: Dust Table Construction

Description

Dust tables consist of four primary components that are built together to create a full table. Namely, the head, the body, the interfoot, and the foot. Dust tables also contain a table-wide attributes border_collapse and longtable as well as a print_method element.

Usage

dust(object, ..., tidy_df = FALSE, keep_rownames = FALSE,
  glance_foot = FALSE, glance_stats = NULL, col_pairs = 2,
  byrow = FALSE, descriptors = "term", numeric_level = c("term",
  "term_plain", "label"))

redust(x, table, part = c("head", "foot", "interfoot", "body"))

Arguments

object
An object that has a tidy method in broom
...
Additional arguments to pass to tidy
tidy_df
When object is an object that inherits the data.frame class, the default behavior is to assume that the object itself is the basis of the table. If the summarized table is desired, set to TRUE.
keep_rownames
Whe tidy_df is FALSE, setting keep_rownames binds the row names to the data frame as the first column, allowing them to be preserved in the tabulated output. This is only to data frame like objects, as the
glance_foot
Arrange the glance statistics for the foot of the table. (Not scheduled for implementation until version 0.4.0)
glance_stats
A character vector giving the names of the glance statistics to put in the output. When NULL, the default, all of the available statistics are retrieved. In addition to controlling which statistics are printed, this also controls the ord
col_pairs
An integer indicating the number of column-pairings for the glance output. This must be less than half the total number of columns, as each column-pairing includes a statistic name and value. See the full documentation for the unexported function
byrow
A logical, defaulting to FALSE, that indicates if the requested statistics are placed with priority to rows or columns. See the full documentation for the unexported function glance_foot.
descriptors
A character vector indicating the descriptors to be used in the table. Acceptable inputs are "term", "term_plain", "label", "level", and "level_detail". These may be used in any combina
numeric_level
A character string that determines which descriptor is used for numeric variables in the "level_detail" descriptor when a numeric has an interaction with a factor. Acceptable inputs are "term", "term_plain", and
x
A dust object
table
A data frame of similar dimensions of the part being replaced.
part
The part of the table to replace with table

Value

  • Returns an object of class dust

Upcoming Developments

  • dust_part
{A wrapper for extracting objects from a dust object. This is intended to assist in building custom heads and feet.}

Details

The head object describes what each column of the table represents. By default, the head is a single row, but multi row headers may be provided. Note that multirow headers may not render in markdown or console output as intended, though rendering in HTML and LaTeX is fairly reliable. In longtables (tables broken over multiple pages), the head appears at the top of each table portion. The body object gives the main body of information. In long tables, this section is broken into portions, ideally with one portion per page. The interfoot object is an optional table to be placed at the bottom of longtable portions with the exception of the last portion. A well designed interfoot can convey to the user that the table continues on the next page. The foot object is the table that appears at the end of the completed table. For model objects, it is recommended that the glance statistics be used to display model fit statistics. The border_collapse object applies to an entire HTML table. It indicates if the borders should form a single line or distinct lines. The longtable object determines how many rows per page are printed. By default, all content is printed as a single table. Using the longtable argument in the sprinkle function can change this setting. The print_method object determines how the table is rendered when the print method is invoked. The default is to print to the console.

See Also

tidy glance_foot tidy_levels_labels

Examples

Run this code
x <- dust(lm(mpg ~ qsec + factor(am), data = mtcars))
x

Run the code above in your browser using DataLab