[Gstat-info] missing values and duplicates in gstat for R

Ulrich Leopold uleopold at science.uva.nl
Fri Feb 29 16:40:35 CET 2008


Dear list,

I am having some problems with dealing with missing values in gstat computing
a semivariogram.

I am using R 2.6.2, sp 0.9-19 and gstat 0.9-43 on Ubuntu Linux 7.10.

I get the follwoing error message:

> variogram(sand ~1, soilcore_nodup.tmp)
Error: dimensions do not match: locations 374 and data 184

This message occurs due to 187 x,y coordinate pairs and 184 values for the
variable sand. I think the locations information is not correct as divided by
2 it would give the real number of locations (= 187 not 374).

Nevertheless, I do not know how to handle the 3 missing values from variable
"sand" (187-184) in order to compute a semivariogram. Is there a function like
"na.rm=TRUE" or "na.omit()" I could use?

Another question is how can I rather average duplicates than removing them?

Thanks for any suggestions or comments,
Ulrich



More information about the Gstat-info mailing list