-
Notifications
You must be signed in to change notification settings - Fork 991
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
Allow locking or protecting a data.table from any modifications #1086
Comments
maybe we can use # in-place assign by reference
dt[, a := b]
dt[, a := b, drop=TRUE]
# copy `a` column
dt[, a := b, drop=FALSE] This way we can not modify our initial data.table, and have the results materialized as copy. And there is |
I think OP wants to prevent semi-accidental modifies, not intentional ones. To achieve what the above |
Good point. |
@ClaytonJY I just pushed that functionality into separate package. It allows you to stick to data.table master. jangorecki/dtq will inject same functionality as mentioned data.table branch. |
Any news about the state of locking data.tables? I ran into the same requirement, see Update: The package Is it possible to add this feature into the THX! PS: Code snippet in the
Source: https://github.com/jangorecki/dtq/blob/master/R/zzz.R |
This is a (partial?) duplicate of the older #778 |
As noted in #778, I'm not sure it's possible to use the However, we could still fulfill this issue with a new function like This would also get around the back-compatibility flaws of the |
This issue arose from Stack Overflow here: https://stackoverflow.com/questions/29085334/lock-or-protect-a-data-table-in-r
I would like to be able to make a data.table unmodifiable. In the comments below my question, two changes to the data.table package are proposed by other users:
lockBinding()
function[.data.table
here: https://github.com/jangorecki/data.table/tree/read.onlyEither solution would work for me.
The text was updated successfully, but these errors were encountered: