print.report_spec | R Documentation |
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.
## S3 method for class 'report_spec'
print(x, ..., verbose = FALSE)
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. |
The report spec, invisibly.
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()
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'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.