Skip to content
Prev 6602 / 29559 Next

where to tweak memory allocation settings

On Thu, 8 Oct 2009, Jochen Albrecht wrote:

            
You have not reported sessionInfo() or your operating system (Windows?). 
See the R for Windows FAQ for memory management there. In fact the problem 
isn't the number of points (here 3.5 million, presumably the raster cells 
with data, not 6.5 million for global coverage), it is 
likely the combination of character columns and their conversion into 
factor form - do they contain long character strings?
To read into a SpatialPixelDataFrame object, you still need points, or go 
through a SpatialGridDataFrame. For a SpatialGridDataFrame, store the data 
as a multiband GeoTiff for example. If however there is something odd - 
long character strings as attributes, the problem will be the same. One 
advantage of going through a SpatialGridDataFrame is that the 3.5 million 
row names fo not get generated and do not take up space - readOGR() always 
generates feature IDs from the input geometry FIDs. If the support is grid 
support, use a gridded representation, as in Robert's suggestion for 
using the raster package.

Hope this helps,

Roger