With the latest release and development data.table versions, the following example results in a segfault with no warning:
library(data.table)
agg <- function(x) if(length(x) > 0) min(x) else NA
d <- data.table(id = c(1,1,2,2), x = c('y','y','y','z'), v = c('a','b','c','d'))
dcast(d, formula = id ~ x, fun.aggregate = agg, value.var = 'v')
Careless use of NA instead of NA_character_ in the aggregation function is my fault. But I hope such errors could be handled more gracefully.
With the latest release and development data.table versions, the following example results in a segfault with no warning:
Careless use of
NAinstead ofNA_character_in the aggregation function is my fault. But I hope such errors could be handled more gracefully.