write_rmd | R Documentation |
This function generates R-Markdown documents by including
the settings as arguments of the function.
Comments and pieces of header can be also added through the argument
append
.
write_rmd(object, ...)
## S3 method for class 'rmd_doc'
write_rmd(object, filename, ...)
object |
rmd_doc object used to write an Rmarkdown file. If
header is missing, |
... |
Further arguments passed among methods (not yet used). |
filename |
A character value with the name of the file to be written. It is not necessary to include the extension *.Rmd in this argument. If missing, the function will use the name of the input object. |
A character vector of class rmd_doc
and, if argument set for parameter
filename
, an Rmd file.
## Not run:
my_document <- list(
title = "Sample Document",
author = "Miguel Alavarez",
output = "html_document",
body = txt_body(
"# Intro",
"",
"This is just an example."
)
)
my_document <- as(my_document, "rmd_doc")
write_rmd(my_document, filename = file.path(tempdir(), "example"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.