Skip to content

Don't warn about picking a value.var if fun.aggregate is explicitly length #2980

@MichaelChirico

Description

@MichaelChirico

If I'm not mistaken, it doesn't matter what value.var is when fun.aggregate is length. Hence, I often forget to set it explicitly in such cases and the warning message comes across as unnecessary noise:

DT = data.table(a = sample(10, 1000, TRUE), b = rep(1:5, 200))
dcast(DT, a ~ b, fun.aggregate = length)

Using 'b' as value column. Use 'value.var' to override

     a  1  2  3  4  5
 1:  1 29 14 30 19 23
 2:  2 15 22 15 16 11
 3:  3 17 14 17 20 18
 4:  4 17 18 26 16 31
 5:  5 13 19 26 16 18
 6:  6 21 22 15 16 25
 7:  7 29 24 27 27 20
 8:  8 12 20  9 25 16
 9:  9 23 30 17 20 16
10: 10 24 17 18 25 22

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions