Dear Mikael,
 
Try to split the locations you want to interpolate into different
subset. Interpolate each of the subsets and them merge them together.
 
HTH,
 
Thierry
 

------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
Thierry.Onkelinx@inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey




________________________________

Van: r-sig-geo-bounces@stat.math.ethz.ch
[mailto:r-sig-geo-bounces@stat.math.ethz.ch] Namens Mikael Carlsson
Verzonden: maandag 3 november 2008 23:54
Aan: r-sig-geo@stat.math.ethz.ch
Onderwerp: [R-sig-Geo] Memory issue


Hi,



First, thanks for all help so far...but I still have some problems.
Here is the code:
cumark <- read.table("k:/test/helamarkcu.txt", header=T, sep = ";")

memory.limit(size = 1897)    
attach(cumark)
vew <- as.vector(ew)
vns <- as.vector(ns)
vcu <- as.vector(cu)

fcumark <- data.frame(vew, vns, vcu)

coordinates(fcumark) <- ~vew+vns  

L1 <-round((max(vew)- min(vew))/100,0)
L2 <-round((max(vns)- min(vns))/100,0)


fcumark.interp.old <- interp.old(vew, vns, vcu,
                xo= seq(min(vew), max(vew), length = L1),
                yo= seq(min(vns), max(vns), length = L2),
                ncp = 0,  
                extrap= FALSE,
                duplicate = "mean",
                dupfun = NULL)
Then I get this;
Error: cannot allocate vector of size 351.8 Mb

When I tested with a smaller file (~2000 rows) I come to the end without
problems.

Rest of the code..

fcumark.interp.old.grid <-
as.SpatialGridDataFrame.im(as.im(fcumark.interp.old))

##  spplot(fcumark.interp.old.grid, col.regions=bpy.colors(),
sp.layout=list("sp.points", pch="+", fcumark))

slot(slot(fcumark.interp.old.grid, "grid"), "cellsize") <-
rep(mean(slot(slot(fcumark.interp.old.grid,
   "grid"), "cellsize")), 2)

write.asciigrid(fcumark.interp.old.grid[1], "k:/test/helamarkcu.asc",
na.value = -9999)
## End run

helamarkcu.txt is a plain ascii file, looks like...
ew;ns;cu
1344628;6138662;24.0
1340104;6138880;17.0
1342246;6138946;21.0
1347259;6140911;19.0
1339968;6140932;15.0
1349906;6140987;21.0
...
..
.
(38155 rows)
Have anybody a solution? Writing result from interp.old direct to
disk/file on the "fly"?

Running R 2.7.2 and WinXP

Regards,
Mikael


Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed document.

	[[alternative HTML version deleted]]


