You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…Col==3] where DT is one row and someCol is NA, returns no rows for consistency with nrow>1 cases. +with=FALSE with := now warns. +nomatch with := now warns. +logical i no longer recycles unless length 1 or nrow. #1001#1002#759#354#166 and closes#1252.
Submitted by: Frank Erickson; Assigned to: Arun ; R-Forge link
If I attempt to make a new column in x with
x[y,newcol:=my_ycol]
and fail to do so (because x[y] has no matches), I would like a message.
One idea: there is already a nice message (with verbose turned on) for
x[logi,newcol:=my_val]
where logi is FALSE:
No rows pass i clause so quitting := early with no changes made.
Another idea: there is already a nice error when assigning to NA after bad subsetting:
x <- data.table(a=1:2)
x[c(FALSE,FALSE,TRUE),newcol:=1]
which gives:
Error in
[.data.table
(x, c(FALSE, FALSE, TRUE),:=
(newcol, 1)) :i[1] is NA. Can't assign by reference to row 'NA'.
And a similar error message is given for x[3,newcol:=1].
The text was updated successfully, but these errors were encountered: