Learn R Programming

reporter (version 1.4.4)

print.report_spec: Prints the report specification

Description

A function to print the report specification. The print function will print the report spec in summary form by default. To print in list form, set the verbose parameter to TRUE.

Usage

# S3 method for report_spec
print(x, ..., verbose = FALSE)

Value

The report spec, invisibly.

Arguments

x

The report spec.

...

Additional parameters to pass to the underlying print function.

verbose

Whether to print the report object in verbose (list) form or summary form. The default is FALSE.

See Also

create_report function to create a report specification.

Other report: add_content(), create_report(), footnotes(), options_fixed(), page_by(), page_footer(), page_header(), set_margins(), title_header(), titles(), write_report()

Examples

Run this code
library(reporter)
library(magrittr)

# Create temp file path
tmp <- file.path(tempdir(), "mtcars.txt")

# Create the table
tbl <- create_table(mtcars) %>% 
  titles("Table 1.0", "MTCARS Sample Report") %>% 
  footnotes("* NOTE: Data from 1974")

# Create the report object
rpt <- create_report(tmp) %>% 
  add_content(tbl, align = "left") 

# Write the report to the file system
res <- write_report(rpt)

# Write the modified report object to the console
print(res)

# # A report specification: 1 pages
# - file_path: 'C:/Users/User/AppData/Local/Temp/RtmpWQybXs/mtcars.txt'
# - output_type: TXT
# - units: inches
# - orientation: landscape
# - line size/count: 108/45
# - content: 
# # A table specification:
# - data: data.frame 'mtcars' 32 rows 11 cols
# - show_cols: all
# - use_attributes: all
# - title 1: 'Table 1.0'
# - title 2: 'MTCARS Sample Report'
# - footnote 1: '* NOTE: Data from 1974'

Run the code above in your browser using DataLab