Re: [R-sig-Geo] gstat: choice of inverse distance power in idw() function

2010-09-01 Thread Jon Olav Skoien
I agree with Paul that kriging might be a better option, but if you want to use IDW, the intamap package includes a function for optimizing the power based on cross-validation. In the example for the function interpolate, replace the penultimate line with: x = interpolate(meuse, meuse.grid, lis

Re: [R-sig-Geo] spRbind for spplot

2010-08-18 Thread Jon Olav Skoien
Hi Klaus, When I try plot_poly = rtopObj3$observations plot_poly$predictions = rtopObj3$predictions$var1.pred spplot(plot_poly, c("observations", "predictions")) it does not work since the replacement has 2100 rows and the data has 100. I would like to create a new object (e.g. plot_poly) wh

Re: [R-sig-Geo] anisotropy - intamap

2010-01-14 Thread Jon Olav Skoien
Hi Seba, Your impression was unfortunately right, in the current version of the package on CRAN it is not possible for the anisotropy detection method to take trends into account. Although the trend and the anisotropy parameters should ideally be estimated jointly, I think it would be a decen

Re: [R-sig-Geo] Kriging

2009-12-04 Thread Jon Olav Skoien
Hi Greg, Variogram modelling is slower with large data sets, but 8-10.000 observations should not be a problem, unless you need the results extremely fast. On my computer (3 years old) it takes about 4 seconds with 8.000 random observations, using the variogram function in gstat. Time increas

Re: [R-sig-Geo] optimizeNetwork function in intamapInteractive package (how to use auxiliary predictors)

2009-12-02 Thread Jon Olav Skoien
Hi Tom, it is great that you like the intamap-packages! The optimization function could not use auxiliary predictors properly in the version you tested, but there is now a new version on CRAN (it might take some time before it is distributed) where it is possible to do what you ask for. Plea

Re: [R-sig-Geo] missing values in gstat for R

2009-12-01 Thread Jon Olav Skoien
Hi Friederike, For which variable do you have NAs? If soil moisture is sm, you are missing in the first line: [!is.na(soildmD79.sp$smoist.20.06.2005),] If that is not the problem, it would be helpful if you sent a reproducible example. Cheers, Jon friederike.gerschla...@agrar.uni-giessen.d

Re: [R-sig-Geo] limiting the number of variogram models in intamap

2009-11-17 Thread Jon Olav Skoien
Hi, This is not possible in the version on CRAN now, but has been changed in the development version that you can find on one of the links below (depending on platform), should be on CRAN soon. http://www.intamap.org/downloads/intamap_1.3-1.zip http://www.intamap.org/downloads/intamap_1.3-1.ta

Re: [R-sig-Geo] residuals by subtracting point values from grid values

2009-03-24 Thread Jon Olav Skoien
Hi Els, I think you want to do: idw.pred.zn <- idw(zinc ~ 1, meuse.pred, meuse.val) and for kriging cross-validation: krige.pred.zn <- krige(zinc ~ 1, meuse.pred, meuse.val,model = vgm(14,"Sph",600,0.1)) krige.pred.zn$res = krige.pred.zn$var1.pred - meuse.val$zinc krige.pred.zn$zscore = k

Re: [R-sig-Geo] Fwd: dimensions do not match

2008-04-10 Thread Jon Olav Skoien
Hi, I think Mathieu wanted to know how to create formula strings from variable names. The function "as.formula" should be able to do what he is looking for. as.formula(paste(names(meuse)[4],"~",names(meuse)[6]) ) is an alternative way of calling a function with the formula zinc~dist, knowing