Publish an R Markdown file to Platform Reports
publish_rmd(
rmd_file,
report_id = NULL,
report_name = NULL,
provide_api_key = NULL,
project_id = NULL,
...
)
string, R Markdown file (.Rmd)
integer, ID of an existing report, if provided, the
contents of the report will be replaced. If report_id
is NULL, a new
report will be created.
string, Title of report in platform
bool, Set to true to include API key in report.
integer, Project_id that the report should be added to.
additional parameters to send to rmarkdown::render
. Note:
A temporary file will be used for output_file
if output_file
is not explicitly set and input
will be overwritten with
rmd_file
.
This function also supports passing report_id
, report_name
,
provide_api_key
and project_id
as metadata in the report's
YAML front matter. Just as the title of an RMarkdown document can be set
with title: "my title!"
, these parameters can be set like
civis: report_name: "My Report Name" report_id: 9000
Since report_id
is set, this code will overwrite the existing
report with that number, which may be useful when updating a report on
a schedule. Any argument passed in explicitly to publish_rmd
will be used in place of the corresponding argument set in YAML metadata.
publish_html
to publish html to Civis
# NOT RUN {
# Publish a standard report
publish_rmd("my_beautiful_doc.Rmd")
# Publish a parameterized R Markdown document
# See: http://rmarkdown.rstudio.com/developer_parameterized_reports.html
params <- list("region" = "east", start = as.Date("2015-02-01"))
publish_rmd("my_parameterized_doc.Rmd", params=params)
# }
Run the code above in your browser using DataLab