Skip to content

FR: warn/error when updating and i has duplicates #2837

@MichaelChirico

Description

@MichaelChirico
DT = data.table(a = 1:5)
DT[c(1, 1, 2), a := 3:5][]
#    a
# 1: 4
# 2: 5
# 3: 3
# 4: 4
# 5: 5

It seems the final element to be assigned (here 4 corresponds to the second instance of 1 in i). Not clear what the right behavior is in this case; my guess is most often it's a user mistake, hence a warning. But also possibly an error since "correct" behavior is ambiguous.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationjoinsUse label:"non-equi joins" for rolling, overlapping, and non-equi joins

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions