Closed bart1 closed 4 years ago
A quick work around is to define a small function:
ff<- function(...) unlist(recursive = F,...)
drake_plan(a=target(lapply(2:b, sqrt), transform = map(b=!!(4:6))),
h=target({
o<-list(a)
ff(o)
}, transform = combine(a)), transform=T)
Alternatively the lists can be concatenated:
p<-drake_plan(a=target(lapply(2:b, sqrt), transform = map(b=!!(4:6))),
h=target({
o<-c(a)
}, transform = combine(a)))
Maybe these are simple enough not really to make an issue out if it?
This is a strange edge case. It happens because the splicing code calls do.call("c", args, quote = TRUE)
on the arguments to your command, and the c()
function has formal arguments use.names
and recursive
.
I see no other way to fix this other than to add back those arguments manually after do.call()
. should be fixed now.
Thank you for the quick fix!
I'm not sure if this classifies as a bug or not I just noticed that the transformation of targets removes argument from code. The example below shows that both
recursive=F
anduse.names=F
get removed in the combine target. If i do not transform the plan this is not an issue. Is there a way avoid these changes in the code. Maybe the transform could ignore formal arguments of the unlist function?Created on 2020-05-26 by the reprex package (v0.3.0)