I'm trying to create a column with functions using rowwiseDT. This creates an error.
Debugging, I see the current implementation checks needs_list = lengths(body) != 1L. This check, while simple, misses out on functions (or more generally anything that needs to be wrapped in list).
Reprex:
data.table::rowwiseDT(
x=, func=,
1e3, \(x) x + 1,
1e4, \(x) x + 1,
1e5, \(x) x + 1,
1e6, \(x) x + 1
)
#> Error in rbindlist(body): invalid type/length (closure/4) in vector allocation