View source: R/transform_plan.R
transform_plan | R Documentation |
Evaluate the map()
, cross()
, split()
and
combine()
operations in the transform
column of a
drake
plan.
transform_plan(
plan,
envir = parent.frame(),
trace = FALSE,
max_expand = NULL,
tidy_eval = TRUE
)
plan |
A |
envir |
Environment for tidy evaluation. |
trace |
Logical, whether to add columns to show what happens during target transformations. |
max_expand |
Positive integer, optional.
|
tidy_eval |
Logical, whether to use tidy evaluation
(e.g. unquoting/ |
https://books.ropensci.org/drake/plans.html#large-plans
# nolint
drake_plan, map, split, cross, combine
plan1 <- drake_plan(
y = target(
f(x),
transform = map(x = c(1, 2))
),
transform = FALSE
)
plan2 <- drake_plan(
z = target(
g(y),
transform = map(y, .id = x)
),
transform = FALSE
)
plan <- bind_plans(plan1, plan2)
transform_plan(plan)
models <- c("glm", "hierarchical")
plan <- drake_plan(
data = target(
get_data(x),
transform = map(x = c("simulated", "survey"))
),
analysis = target(
analyze_data(data, model),
transform = cross(data, model = !!models, .id = c(x, model))
),
summary = target(
summarize_analysis(analysis),
transform = map(analysis, .id = c(x, model))
),
results = target(
bind_rows(summary),
transform = combine(summary, .by = data)
)
)
plan
if (requireNamespace("styler", quietly = TRUE)) {
print(drake_plan_source(plan))
}
# Tags:
drake_plan(
x = target(
command,
transform = map(y = c(1, 2), .tag_in = from, .tag_out = c(to, out))
),
trace = TRUE
)
plan <- drake_plan(
survey = target(
survey_data(x),
transform = map(x = c(1, 2), .tag_in = source, .tag_out = dataset)
),
download = target(
download_data(),
transform = map(y = c(5, 6), .tag_in = source, .tag_out = dataset)
),
analysis = target(
analyze(dataset),
transform = map(dataset)
),
results = target(
bind_rows(analysis),
transform = combine(analysis, .by = source)
)
)
plan
if (requireNamespace("styler", quietly = TRUE)) {
print(drake_plan_source(plan))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.