Skip to content

Confusing error message when trying to group by a list column #4308

Closed
@sindribaldur

Description

@sindribaldur
iis <- data.table(iris)
iis[, letts := .(list(sample(letters[1:4], size = 2))), 1:nrow(iris)]
iis[, .N, .(Species, letts)]

Error in `[.data.table`(iis, , .N, .(Species, letts)) : 
  column or expression 2 of 'by' or 'keyby' is type list. Do not quote column names. Usage: DT[,sum(colC),by=list(colA,month(colB))]

"Do not quote column names" seems out of place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    non-atomic columne.g. list columns, S4 vector columns

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions