library(reporter)
library(magrittr)
# Create a temporary file
tmp <- file.path(tempdir(), "bod.rtf")
# Define table
tbl <- create_table(BOD, width = 2.5) %>%
titles("Table 3.6", "BOD¹ Sample Report") %>%
define(Time, format = "Day %s", align = "left") %>%
define(demand, format = "%2.1f mg/l", label = "Demand") %>%
footnotes("¹ Biochemical Oxygen Demand")
# Define report #1 - No blank margins
rpt <- create_report(tmp, orientation="portrait", output_type = "RTF",
font = "Arial", font_size = 9) %>%
add_content(tbl) %>%
report_options(allow_code = TRUE, line_break = FALSE,
auto_page = FALSE,page_wrap = FALSE,
title_block = "paragraph")
# Write the report
write_report(rpt)
Run the code above in your browser using DataLab