Description Usage Arguments Details Note See Also Examples
Publish an R Markdown file to Platform Reports
1 2 3 4 5 6 7 8 |
rmd_file |
string, R Markdown file (.Rmd) |
report_id |
integer, ID of an existing report, if provided, the
contents of the report will be replaced. If |
report_name |
string, Title of report in platform |
provide_api_key |
bool, Set to true to include API key in report. |
project_id |
integer, Project_id that the report should be added to. |
... |
additional parameters to send to |
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
1 2 3 | 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.
rmarkdown::render
depends on a recent version of pandoc
.
pandoc
is distributed with RStudio and thus, publish_rmd
will work in an RStudio environment. Outside of RStudio pandoc
may
be installed or knitr::knit2html
can be used to convert an R
Markdown document into html. The html can then be published to Civis
with publish_html
.
publish_html
to publish html to Civis
1 2 3 4 5 6 7 8 9 10 11 | ## 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)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.