proc_print {procs}R Documentation

Prints a dataset

Description

The proc_print function is used to print a dataset or datasets. To print multiple datasets, pass them to the data parameter in a list. By default, the function prints to the viewer. It may also be used to print to the file system using the output_type and file_path parameters. This print function has limited options, and is meant to quickly view your data or dump it out to a file. For more reporting options, use the reporter package.

Usage

proc_print(
  data,
  file_path = NULL,
  output_type = "HTML",
  titles = NULL,
  style = NULL,
  view = TRUE
)

Arguments

data

The data to print. Can be either a single dataset, or a list of datasets.

file_path

The path of the report to print.

output_type

The type of report to create. Valid values are "TXT", "RTF", "PDF", "HTML", and "DOCX". Default is "HTML".

titles

A vector of titles.

style

A style object, as defined by the reporter package. See that package for details.

view

Whether to send the print output to the viewer. Valid values are TRUE and FALSE. Default is TRUE.

Value

If a file report was produced, the full path of the report. Otherwise, a NULL. In either case, the value will be returned invisibly.

Examples

# Turn off printing to pass CRAN checks
options("procs.print" = FALSE)

# Print mtcars to the viewer
proc_print(mtcars)

# Print mtcars to an RTF
pth <- proc_print(mtcars,
                  file_path = tempfile(fileext = ".rtf"),
                  titles = "MTCARS Proc Print Example",
                  output_type = "RTF", view = FALSE)

# View file
# file.show(pth)

[Package procs version 1.0.6 Index]