tar_sub_raw | R Documentation |
Loop over a grid of values and create an expression object
from each one. Helps with general metaprogramming. Unlike tar_sub()
,
which quotes the expr
argument, tar_sub_raw()
assumes expr
is an expression object.
tar_sub_raw(expr, values)
expr |
Expression object with the starting expression.
Values are iteratively substituted
in place of symbols in |
values |
List of values to substitute into |
A list of expression objects. Often, these expression objects evaluate to target objects (but not necessarily). See the "Target objects" section for background.
Most tarchetypes
functions are target factories,
which means they return target objects
or lists of target objects.
Target objects represent skippable steps of the analysis pipeline
as described at https://books.ropensci.org/targets/.
Please read the walkthrough at
https://books.ropensci.org/targets/walkthrough.html
to understand the role of target objects in analysis pipelines.
For developers, https://wlandau.github.io/targetopia/contributing.html#target-factories explains target factories (functions like this one which generate targets) and the design specification at https://books.ropensci.org/targets-design/ details the structure and composition of target objects.
Other Metaprogramming utilities:
tar_eval()
,
tar_eval_raw()
,
tar_sub()
# tar_map() is incompatible with tar_render() because the latter
# operates on preexisting tar_target() objects. By contrast,
# tar_eval_raw() and tar_sub_raw() iterate over code farther upstream.
values <- list(
name = lapply(c("name1", "name2"), as.symbol),
file = c("file1.Rmd", "file2.Rmd")
)
tar_sub_raw(quote(tar_render(name, file)), values = values)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.