render_report: Render report

Description Usage Arguments Value Optional arguments Author(s) See Also Examples

View source: R/render_report.R

Description

Generate .html reports from pre-prepared Rmarkdown templates.

Usage

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"),
  ...
)

Arguments

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_HOST

pgres_user

string defining the server user name - all reports default to the environment variable PGRES_USER

pgres_pwd

string defining the server password - all reports default to the environment variable PGRES_PWD

pgres_dbname

string defining the server database name - all reports default to the environment variable PGRES_DBNAME

...

additional pass through variables for the rmarkdown::render function

Value

This function will return a .html report file and save it to the path described in the output_dir argument.

Optional arguments

Author(s)

Jay Achar

See Also

hisreportr

Examples

 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)

JayAchar/hisreportr documentation built on March 18, 2020, 5:57 a.m.