| markdownRule | R Documentation |
This rule executes Markdown rendering to create text files in various supported formats such as PDF, DOCX, etc.
markdownRule(target, script, depends = NULL, params = list(), task = "all")
target |
Name of the output file to be created |
script |
Name of the markdown file to be rendered |
depends |
A vector of file names that the markdown script depends on, or |
params |
A list of R values that become available within the |
task |
A character vector of parent task names. The mechanism of tasks allows
grouping rules. Anything different from |
This rule executes the following command in a separate R process:
params <- params; rmarkdown::render(script, output_format=format, output_file=target)
That is, the parameters given in the params argument are stored in the global variable
and then the script is rendered with rmarkdown. Note that the re-generation of the
Makefile with any change to params will not cause the re-execution of the recipe unless
other script dependencies change.
Issuing make clean from the shell causes removal of all files specified in the target parameter.
Instance of S3 class rmake.rule
Michal Burda
rule(), makefile(), rRule()
r <- markdownRule(target='report.pdf',
script='report.Rmd',
depends=c('data1.csv', 'data2.csv'))
# generate the content of a makefile (as character vector)
makefile(list(r))
# generate to file
tmp <- tempdir()
makefile(list(r), file.path(tmp, "Makefile"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.