Description Usage Arguments Value Optional arguments Author(s) See Also Examples
View source: R/render_report.R
Generate .html reports from pre-prepared Rmarkdown templates.
1 2 3 4 5 6 7 8 | render_report(
report_name = c("tb_month", "hiv_month", "hcv_month"),
pgres_host = Sys.getenv("PGRES_HOST"),
pgres_user = Sys.getenv("PGRES_USER"),
pgres_pwd = Sys.getenv("PGRES_PWD"),
pgres_dbname = Sys.getenv("PGRES_DBNAME"),
...
)
|
report_name |
string denoting which pre-specified report to generate |
pgres_host |
string defining the server hostname - all reports default to the
environment variable |
pgres_user |
string defining the server user name - all reports default to the
environment variable |
pgres_pwd |
string defining the server password - all reports default to the
environment variable |
pgres_dbname |
string defining the server database name - all reports default
to the environment variable |
... |
additional pass through variables for the rmarkdown::render function |
This function will return a .html report file and save it to the path
described in the output_dir
argument.
output_dir
: string representing the absolute path for generated output files
params
: passed to the Rmarkdown report template to configure the
generated report. The following parameters are available:
reporting_month
: a vector of integers representing the month(s) being reported.
Where no value is defined, the current month is automatically used.
reporting_year
: vector of integers representing the year(s) being reported. A 4
digit format is required. Where no value is defined, the current year is
automatically used.
Jay Achar
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
# Generate the monthly TB report from Jan-March 2018
# Specify the server password as being stored in an environment variable
render_report(report_name = "tb_month",
output_dir = "~/Documents",
params = list(reporting_month = 1:3,
reporting_year = 2018,
pgres_pwd = Sys.getenv("PGRES_PWD")))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.