Description Usage Arguments Value See Also Examples
View source: R/make_template.R
Applying heddle can leave your template pieces stored as either string objects, vectors (standalone or in a dataframe), or nested vectors (if applied using map()). This function takes those elements and combines them into a single exportable template.
1 |
data |
The dataframe containing variables to be combined. |
... |
The variables to be combined into a template object. |
Returns the collapsed template as a character string.
Other manipulation functions:
create_yaml_header()
,
heddle()
,
provide_parameters()
,
use_parameters()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # When passed vectors, make_template flattens each vector into a single
# string and then combines its arguments from left to right
spList <- data.frame(Species = c(unique(iris$Species), "test string"))
make_template(
heddle(spList, "SPECIES CODE GWAR ", "GWAR" = Species),
heddle(spList, "SPECIES CODE GWAR ", "GWAR" = Species)
)
# When passed variables in a dataframe, make_template collapses each column
# in turn, then combines the output strings from left to right
spList <- data.frame(Species = c(unique(iris$Species), "test string"))
spList$template <- heddle(spList, "SPECIES CODE GWAR ", "GWAR" = Species)
make_template(spList, template)
make_template(spList, template, template)
# When passed nested columns, heddlr collapses each cell into a string,
# then collapses each column into a string, and then combines the outputs
# from left to right
make_template(tidyr::nest(spList, nested = template), nested)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.