-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[R-Forge #4996] provide a message when x[y,newcol:=my_ycol] does not create a new column #354
Labels
Milestone
Comments
@arunsrinivasan Came across this one via #1150. Not sure why closed so reopening to come back to. |
duplicate of #759, IMO it should not be a message but a NA valued column added, as in SQL when using outer join and there is no matching values. |
@mattdowle as Jan points out, this is a duplicate. I must have forgotten to add the issue at the time. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: