-
Notifications
You must be signed in to change notification settings - Fork 1k
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
alter class of data.table object #839
Comments
Try to avoid using Instead use |
The idiomatic way would be to use setattr(dt, c("myClass", class(dt))) Why? In R v3.1+, But still, Try doing: And this is not really an issue, so added the "question" tag. Feel free to re-open the issue if this doesn't answer (completely) (or if you've further questions). |
Yeah, my bad I've forgot about |
Oh right. So to answer your questions specifically:
Yes, it's safe here. The downsides are: a) in versions of R <3.10, it'll copy the entire data.table, and b) in all versions of R, the over-allocation will be lost, which'll result in the warning explained above.
Yes it will (and should). But the idiomatic way is |
I'm storing particular structure of data as data.table object. I would like to easily plot the object.
Is it safe to alter class of data.table in the following way?
I would like to confirm is it safe the add another (my custom) class to DT object? will the rest of data.table functions works fine on my dt or maybe it is not recommended?
The text was updated successfully, but these errors were encountered: