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.
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.