Skip to content
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

Support conversion to data.table? #55

Closed
thiagoveloso opened this issue Jun 6, 2019 · 1 comment
Closed

Support conversion to data.table? #55

thiagoveloso opened this issue Jun 6, 2019 · 1 comment

Comments

@thiagoveloso
Copy link

Data.tables are usually considerably faster to process than data frames. I was looking for ways to convert raster objects to data.tables preserving as much information as I could, and I just stumbled upon this function written by Etienne Racine: https://gist.github.com/etiennebr/9515738.

Then I was wondering: any chance this function could be included in the raster package as a native one?

@rhijmans
Copy link
Member

rhijmans commented May 2, 2021

I am not going to add this to raster. It seems to me that for most cases this suffices:

v <- as.data.table(as.data.frame(x))
setnames(v, names(x))

@rhijmans rhijmans closed this as completed May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants