I am not sure why this happens but the problem is solved if I use paste(quote(id)) like in this plan:
spamPlan = drake_plan(
x = target(runif(n1),
transform = map(n1,
.data = !!inputFrame)),
y = target(x*100,
transform = map(x)),
z = target(data.frame(s = sum(y),
id = as.character(quote(id))),
transform = combine(y,
id,
.by = id))
)
Is it worth considering to perform such a transformation to the appropriate class within drake?
The variable id is part of the plan and I would expect that the variable should be resolved.
Prework
Question
I would like to use a grouping variable inside the command that builds a target. Using drake's
combine
returns an object that cannot be used directly.Reproducible example
I am not sure why this happens but the problem is solved if I use
paste(quote(id))
like in this plan:Is it worth considering to perform such a transformation to the appropriate class within drake? The variable
id
is part of the plan and I would expect that the variable should be resolved.