| FileTemplate | R Documentation |
A class for reading a file template, replacing tags inside, and writing the results in an output file.
new()Initializer.
FileTemplate$new(path)
pathThe path to the template file.
Nothing.
replace()Replace a tag by its value inside the template file.
FileTemplate$replace(tag, value)
tagThe tag to replace.
valueThe value to replace the tag with.
invisible(self) for chaining method calls.
choose()Choose one case among a set of cases.
FileTemplate$choose(set, case)
setThe name of the case set.
caseThe name of case.
invisible(self) for chaining method calls.
select()Select or remove sections that match a name.
FileTemplate$select(section, enable)
sectionThe name of the section.
enableSet to TRUE to select the section (and keep it), and FALSE to remove it.
invisible(self) for chaining method calls.
write()Write template with replaced values to disk.
FileTemplate$write(path, overwrite = FALSE, checkRemainingTags = TRUE)
pathPath to output file.
overwriteIf set to FALSE and the destination file already exists, a message is thrown. Otherwise writes into the destination.
checkRemainingTagsIf set to TRUE, checks first, before writing, if there any remaining tags that have not been processed. A warning is thrown for each found tag.
Nothing.
getLines()Get the lines of the templates.
FileTemplate$getLines()
A vector containing the lines of the templates.
clone()The objects of this class are cloneable with this method.
FileTemplate$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.