A set of example files relevant to emailing with R Markdown in RStudio Connect can be spawned in a specified location. There is a set of three files that work together to provide a full report, an emailable version of that report, and a file attachment; these files are:
The location to which the files (in a subdirectory named
"connect-example-main.Rmd": The main R Markdown document. Contains
a report template culminating in a final R code chunk that has calls to
"connect-example-email.Rmd": An R Markdown document that contains
the email message. It is associated with the main R Markdown document by
incorporating some of its content (i.e., by reusing chunk names and extending
assigned values). It uses the
blastula::blastula_email output type in the
YAML front matter.
"austin_home_sales.csv": A CSV file that will be included as an
attachment by way of the
attachments argument in the
attach_connect_email() function call within the main R Markdown document.
The main report and associated email can be published by opening
"connect-example-main.Rmd" and pressing the Publish button at the top-right
of the Editor pane (please ensure beforehand that you are set up work with
RStudio Connect). If asked
"What do you want to publish?", choose the first
option where only the
"connect-example-main" document is published. All
three files should be checked in the final dialog box, press the
button to publish to RStudio Connect.
There is also the single
"connect-example-text-only.Rmd" file that, when
published, serves as a mechanism to send a text-only email. The content of
the email is specified directly in the single
function call and all other text in the R Markdown file is disregarded.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.