myknit | R Documentation |
myknit can be used to make the process of knitting more flexible.
The Usage and Arguments section specify how the function would be used on a standalone base.
Normally however I do the knit
with the knit button in RStudio.
When I include in the yaml metadata block the yaml statement
knit: (function (...) { HOQCutil::myknit(...) })
the myknit
code will be run instead of rmarkdown::render
.
The myknit
function removes (R) commented lines from the yaml metadata block and can do one or more of the following things (based on extra YAML statements):
specify an alternative name for the output file (based on hoqc_output
)
append a version indicator to the name of the output file (based on hoqc_version
)
force that the proper extension is given to the name of the output file (when not specified) (based on hoqc_force_ext
)
create a file with the yaml metadata block that was specified with a name including the version indicator (based on hoqc_yaml
)
create a file with the yaml metadata block after processing with a name including the version indicator (based on hoqc_yaml_new
)
create a copy of the input file with a name including the version indicator (based on hoqc_rmd_in
)
create a copy of the processed input file with a name including the version indicator (based on hoqc_rmd_out
)
An example of use is given in the
pdf file
and the corresponding
rmd file of the GitHub repository
rmd_pdf_examples.
Note: in the repository the myknit function is (still) included as a separate function.
myknit(
inputFile,
encoding = getOption("encoding"),
hoqc_render = TRUE,
clean = TRUE
)
inputFile |
base file to render |
encoding |
encoding of basefile |
hoqc_render |
boolean to indicate that output file is to be created. Default TRUE |
clean |
boolean to indicate that intermediary files are removed. Default TRUE |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.