Skip to main content
2 of 2
removed appreciation
Vince
  • 20.3k
  • 16
  • 48
  • 65

How to store raster brick in memory, rather than on disk in R?

I am trying to run analysis on the yearly weather data files here: https://www.northwestknowledge.net/metdata/data/. I'm running into a problem where each yearly file for each variable requires 2.4GB memory if I read it in using ncdf4 package. I can use the raster packages brick function to create a pointer to the file on disk, but this is very slow.

How do I store a raster brick in my computer's memory, rather than just create a pointer? Also, does anyone have ideas on how to reduce the size of these files in R (they're about 100MB on disk)?