pixiedust (version 0.8.3)

print.dust: Print A dust Table

Description

Apply the formatting to a dust object and print the table.

Usage

# S3 method for dust
print(x, ..., asis = TRUE, linebreak_at_end = 2)

# S3 method for dust_list print(x, ..., asis = TRUE)

Arguments

x

An object of class dust

...

Additional arguments to pass to the print method. Currently ignored.

asis

A logical value that controls if the output is printed using knitr::asis_output. See Details.

linebreak_at_end

Used only in HTML tables; defines the number of line break tags </br> appended to the end of the table in order to generate whitespace between then end of the table and the subsequent element. By default, two line breaks are used.

Details

The printing format is drawn from options()$dustpan_output and may take any of the values "console", "markdown", "html", or "latex"

The markdown, html, and latex output is returned via asis_output, which forces the output into the 'asis' environment. It is intended to work with Rmarkdown, and the tables will be rendered regardless of the chunk's results argument. Currently, there is no way to to capture the code for additional post processing.

When asis = TRUE (the default), the output is returned via knitr::asis_output, which renders the output as if the chunk options included results = 'asis'. Under this setting, the table will be rendered regardless of the value of the results option. Using asis = FALSE returns a character string with the code for the table. This may be rendered in a markdown document via cat(print(x, asis = FALSE)) with the chunk option results = 'asis'. (If working with an Rnw file, the chunk option is results = tex). The only way to use the asis argument is with an explicit call to print.dust.

Examples

Run this code
# NOT RUN {
dust(lm(mpg ~ qsec + factor(am), data = mtcars))
# }

Run the code above in your browser using DataCamp Workspace