-
Notifications
You must be signed in to change notification settings - Fork 978
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
Inconsistent replacement of list column element with NULL in table with 1 row #5558
Labels
Comments
I can do this: library(data.table)
DT1=data.table(L=list("A"),i=1)
DT1[, `:=`(L = list(NULL))] that works, but oddly not
which should be identical per |
tdhock
changed the title
can not replace list column element with NULL in table with 1 row
Inconsistent replacement of list column element with NULL in table with 1 row
Dec 9, 2022
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In base R data.frame we can replace an element of a list column with NULL via:
However in data.table, doing that results in deleting the list column entirely:
Request: can we make the above code do a replacement (like base R data.frame) instead of deleting the column?
The above issue is confusing because it is inconsistent with how data table handles replacement in tables with more than one row:
Actually, we can do the replacement (inconsistently) in data.table via
The text was updated successfully, but these errors were encountered: