Description Usage Arguments Value See Also Examples
View source: R/parseTemplate.R
parseTemplate()
reads fileIn
and uses
sprintf
to make string replacements.
1 | parseTemplate(fileIn, ...)
|
fileIn |
path to template file (quoted string) |
... |
objects to use as string replacements |
A string representing the contents of fileIn
after the
specified replacements have been made. As the string is a length one
character vector, new lines (\n
) have been inserted accordingly.
1 2 3 4 5 6 7 8 | x <- c("My %s favorite", "%s is a %s.")
write(x, "x.txt")
system("more x.txt")
y <- parseTemplate("x.txt", "least", "animal", "cat")
print(y)
write(y, "y.txt")
system("more y.txt")
file.remove("x.txt", "y.txt")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.