I have rasters over which I am performing mathematical operations. For example, where I need to calculate flow distance or distance between two grid points.
What format is generally considered faster for such operations?
Should I work directly on the raster format, instead?
I also converted the data to matrix and dataframe
as.matrix and as.data.frame
The raster has entirely numeric values.
Not sure which is faster. I am new to raster package in R, and I have mostly only worked in dataframes.
Best Answer
"Faster" is relative. Faster to upload? Faster to access and run calculations? Because so many variables exist between systems and data, the best way to get a guaranteed answer for your processes and data is to run it using each of the three formats.
A similar Stack Exchange Answer can be found here: Data frame or matrix?