[R-sig-Geo] R crashes performing gstat IDW with omax argument

Mark Wynter mark at dimensionaledge.com
Mon Nov 24 05:19:13 CET 2014



I'm trying to use gstat's IDW function with an omax argument
Addition of the omax argument causes R to crash - works fine without it.

*** Error in `/usr/lib/R/bin/exec/R': corrupted double-linked list:
0x00000000038c8540 ***
I'm running R v 3.1 on Ubuntu 12.04

Can anyone else replicate this error on R 3.1 with the following script?

#Crashtest
#Libraries
library(sp)
library(gstat)
library(RColorBrewer)

#make some random xyz point data
x = round(runif(100), 2)
y = round(runif(100), 2)
z = data.frame(rainfall=round(runif(100), 2)*1000)

#convert to spatial points data frame
xy = cbind(x, y)
xy.sp = SpatialPoints(xy)
xy.spdf = SpatialPointsDataFrame(xy.sp, z)

#prepare grid surface
x.range <- range(xy.spdf at coords[,1])
y.range <- range(xy.spdf at coords[,2])
grd <- expand.grid(x=seq(from=x.range[1]-0.5, to=x.range[2]+0.5, by=0.01),
y=seq(from=y.range[1]-0.5, to=y.range[2]+0.5, by=0.01) )
coordinates(grd) <- ~ x+y
gridded(grd) <- TRUE

#perform IDW interpolation and plot results
precip.pal <- colorRampPalette(brewer.pal(7, name="Blues"))
precip.idw3 <- idw(rainfall~1, xy.spdf, grd, idp = 3, maxdist=0.2, omax=2)
spplot(precip.idw3, "var1.pred", col.regions=precip.pal, pretty=TRUE,
main="Rainfall Interpolated (mm)", labels=TRUE,
      sp.layout=list("sp.points", xy.spdf, col="red", first=FALSE))

Sent from my iPhone



More information about the R-sig-Geo mailing list