Consider the following MWE. How do I get the m1 and m2 integers instead of expressions to be exposed to the func() arguments, instead of "object '1' not found"?
func <- function(x, m1, m2) {
paste("M1=", m1, "M2=", m2, ": ", mean(unlist(x)))
}
p <- drake_plan(
a = target(
runif(10, m1, m2),
transform = cross(m1 = 0, m2 = c(1,2), n = !!c(1,5))
),
b = target(
func(list(a), m1, m2),
transform = combine(a, .by = m2)
)
)