mlr-org / mlr3misc

Miscellaneous helper functions for mlr3
https://mlr3misc.mlr-org.com
GNU Lesser General Public License v3.0
11 stars 2 forks source link

map_dtc doesnt work when the mapped call return dts #1

Closed berndbischl closed 5 years ago

berndbischl commented 5 years ago

i would like to do this

foo = function(mu) {
  setDT(as.data.frame(rnorm(2, mean = mu)))
}
d = map_dtc(1:3, foo) # doenst work
print(d)

# this works
d = lapply(1:3, foo)
d = do.call(cbind, d)
print(d)