Learn R Programming

pixiedust (version 0.1.1)

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_attributes object and a print_method object.

Usage

dust(object, ..., glance_foot = TRUE, tidy_df = FALSE)

Arguments

object
An object that has a tidy method in broom
...
Additional arguments to pass to tidy
glance_foot
Arrange the glance statistics for the foot of the table. (Not scheduled for implementation until version 0.4.0)
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.

Value

  • Returns an object of class dust

Upcoming Developments

  • inspect_dust
{Function to evaluate a dust object for things such as incompatible columns (the table head might have 7 columns while the body only has 6, for example); sprinkles not supported by the print method (colored text in the console); or sprinkle selections that may cause conflicts (hopefully this won't occur, but there is potential for problems in combining attributes in LaTeX).} 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 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 portion 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 table_attributes object stores information to apply to the entire table.

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

Examples

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

Run the code above in your browser using DataLab