warning: Parameter 2 to gmap_gmap() expected to be a reference, value given in /home/spatiala/public_html/book/includes/module.inc on line 497.

First steps (meuse)

Short title: 
meuse
Purpose and use: 
demonstration of geostatistical tools (first steps in): gstat, geoR, SAGA GIS;
Programming environment: 
R / S language
Status of work: 
Tested on a MS Windows machine only
AttachmentSizeHitsLast download
meuse.R23.43 KB204113 hours 37 min ago

Comments

error with krige.conv in meuse.R

Thanks for the very nice examples in meuse.R and the comparisons between gstat and SAGA.

In meuse.R at line 429 I am getting an error when executing the following code:

zinc.rk2 <- krige.conv(zinc.geo, locations=locs, krige=KC, borders=mask.bor)
krige.conv: results will be returned only for prediction locations inside the borders
krige.conv: model with mean defined by covariates provided by the user
error in krige.conv(zinc.geo, locations = locs, krige = KC, borders = mask.bor) :
  locations and trend.l have incompatible sizes
> str(zinc.geo)
List of 3
 $ x, y : num [1:155, 1:2] 181072 181025 181165 181298 181307 ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ : chr [1:155] "300" "455" "459" "540" ...
  .. ..$ : chr [1:2] "x" "y"
 $ data                                : num [1:155] 1022 1141 640 257 269 ...
 $ PC1, PC3, PC5, PC6, PC7 :'data.frame':       155 obs. of  5 variables:
  ..$ PC1: num [1:155] -2.862 -2.587 -2.537 -0.482 -0.483 ...
  ..$ PC3: num [1:155] -0.524 -0.608 -0.57 1.278 1.33 ...
  ..$ PC5: num [1:155] 0.58 -0.114 0.452 -0.807 -0.124 ...
  ..$ PC6: num [1:155] 0.2465 0.1348 -0.1568 0.2205 -0.0447 ...
  ..$ PC7: num [1:155] -4.44e-16 -9.99e-16 1.11e-16 4.44e-16 1.55e-15 ...
 - attr(*, "class")= chr "geodata"
> str(locs)
'data.frame':   8008 obs. of  2 variables:
 $ Var1: num  178500 178540 178580 178620 178660 ...
 $ Var2: num  329620 329620 329620 329620 329620 ...
 - attr(*, "out.attrs")=List of 2
  ..$ dim     : int  77 104
  ..$ dimnames:List of 2
  .. ..$ Var1: chr  "Var1=178500" "Var1=178540" "Var1=178580" "Var1=178620" ...
  .. ..$ Var2: chr  "Var2=329620" "Var2=329660" "Var2=329700" "Var2=329740" ...
> str(mask.bor)
num [1:267, 1:2] 178880 178880 178760 178760 178720 ...

Is this a known error?

I am running R-2.11.1 on FreeBSD 9.0-CURRENT (amd64) with newest R packages available.

Rainer Hurling