library(data.table)
DT <- data.table(V1 = c("A", "B", "C"), V2 = list(c(1, 2), NA, c(10, 20, 30)))
DT[, list(unlist(V2)), V1]
# Error in `[.data.table`(DT, , list(unlist(V2)), V1) :
# Column 1 of result for group 2 is type 'logical' but expecting type 'double'. Column types must be consistent for each group.
DT2 <- data.table(V1 = c("A", "B", "C"), V2 = list(c(1, 2), NA_real_, c(10, 20, 30)))
DT2[, list(V2 = unlist(V2)), V1]
# V1 V2
# 1: A 1
# 2: A 2
# 3: B NA
# 4: C 10
# 5: C 20
# 6: C 30