Dear All,

I am running a geostatistical analysis using the package "fields" of 
n=980 and grid of approximately 1x1 km with 4 m of spatial resolution.  
Because the fine grid resolution of 4 meters, which I really need for my 
experiment, I am having problems with memory allocation.  I am using an 
OS linux 32 bit (i686-pc-linux-gnu) with 4 Gb of memory and 2 Gb of swap 
and R version 2.12.0.  Running the R command gc() in my computer, I have 
the following:

 >gc()
             used        (Mb)   gc      trigger      (Mb)      max used  
(Mb)
Ncells   147153      4.0              350000      9.4           350000   9.4
Vcells    86617       0.7              786432       6.0          
434604   3.4

I tried to work around of my memory issue (?Memory) for Linux, start R 
with the command *R --min-vsize=100M --max-vsize=3G --min-nsize=100M 
--max-nsize=3G*, but still I did not saved the problem of memory 
allocation.  I know that the solution could be: (1) install a OS 64bits 
or (2) reduce the spatial resolution of my grid (e.g. for 10x10 m).  
However, I can not format my computer right now and I need a grid of 4 x 
4 m.

I would like to ask you the following:
1 - How I could increase the memory allocation of my linux?  Is there 
something wrong with my work around of memory allocation showed above?
2 - Is possible to apply the use of the R package  e.g. "bigmemory" in 
my geostatistic script (please see bellow)?  If yes, how it could be?  
My problem is only in the last command of my script when I call the 
function "predict" of fields.

My script is bellow:

Any help will be very welcome.
Thanks for your attention.
Fernando

###########################################
dat <- read.csv("/home/fernando/Desktop/data.csv")
library(fields)

# set  x-y  coordinates of image, considering the center of each pixel
col_xcoord <- seq(723606,724902,by=4)         #  correct: 325
row_ycoord <- seq(9661022,9662346,by=4)   #  correct: 332
xmin = min(col_xcoord)
ymin = min(row_ycoord)
locs.x = col_xcoord-xmin
locs.y = row_ycoord-ymin
newlocs = expand.grid(locs.x,locs.y)

locs = data.frame(dat$long-xmin,dat$lat-ymin)  # adjusted location as 
data frame
sqrt.gf = sqrt(dat$gap.frac)                                   # The 
response variable

#################################################
# Produce the Kriging estimates using exponential variogram with scale 
parameter 24.15
#################################################

fit = Krig(locs,sqrt.gf,theta=24.15)
# I used the range parameter 24.15 estimated earlier

summary(fit) # summary of fit

# HERE I HAD THE ERROR OF MEMORY ALLOCATION
# "predict" the kriging values
krig.out = predict(fit,newlocs)
# Error: cannot allocate vector of size 806.7 Mb

# This takes about 2 minutes on Mac of my friend
# but it did not work in my linux





	[[alternative HTML version deleted]]

