[R-sig-eco] memory issues using Tps (package fields)

Jorge Velasquez jorge at life.bio.sunysb.edu
Thu Jun 17 22:25:06 CEST 2010


Hi there,

I'm trying to run a interpolation of climate using the functionTps
(Thin plated splines) from the package fields, but keep running into
the following error:

Error: cannot allocate vector of size 488 Kb
In addition: Warning messages:
1: In names(y) <- make.unique(cols) :
  Reached total allocation of 3583Mb: see help(memory.size)
2: In names(y) <- make.unique(cols) :
  Reached total allocation of 3583Mb: see help(memory.size)
3: In names(y) <- make.unique(cols) :
  Reached total allocation of 3583Mb: see help(memory.size)
4: In names(y) <- make.unique(cols) :
  Reached total allocation of 3583Mb: see help(memory.size)
Error in as.matrix(expand.grid(grid.list)) :
  error in evaluating the argument 'x' in selecting a method for
function 'as.matrix'

The code I'm running is:

predGrid<-read.table("demaspoint_id8.csv" ,sep="," ,header=TRUE)
data<-read.table("precp00-09ContSampleDem.csv",sep="," ,header=TRUE)
fit<-Tps(data[,c("x","y")],data[,"Ene"],Z=data$dem)
result<-predict.surface(fit,grid.list=list(x=predGrid[,c("Longitude","Latitude")],Z=predGrid[,"GRID_CODE"]))

The file predGrid has ~65000 rows. The error is persistent even using
a machine with 8GB Ram, double xeon processor, and the 64bit version
of R, although the error pasted above is for the 32 bit version.

Is there any solution to this? Am I missing something?

Thanks,

Jorge
-- 
---
Jorge Velasquez
Department of Ecology and Evolution
Stony Brook University
Stony Brook, NY 11974
Phone:(631) 632-1445
http://life.bio.sunysb.edu/~jorge/



More information about the R-sig-ecology mailing list