[R-sig-Geo] Variogram Plot

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Tue Mar 18 10:18:02 CET 2008


> library(geoR)
Loading required package: sp

-------------------------------------------------------------
Analysis of geostatistical data
For an Introduction to geoR go to http://www.leg.ufpr.br/geoR
geoR version 1.6-20 (built on 2007-11-28) is now loaded
-------------------------------------------------------------

> n <- 14000
> map <- data.frame(x = runif(n, max = 400), y = runif(n, max = 400),
value = rnorm(n))
> selection <- as.geodata(map)
> coal.var <- variog(selection, max.dist = 280)
variog: computing omnidirectional variogram
Error: cannot allocate vector of size 747.6 Mb
> traceback()
3: dist(as.matrix(coords))
2: as.vector(dist(as.matrix(coords)))
1: variog(selection, max.dist = 280)

It looks like geoR gets in troubles when it calculates the distance
matrix.

> selection <- as.geodata(map[sample(seq_len(n), 8000), ])
> coal.var <- variog(selection, max.dist = 280)
variog: computing omnidirectional variogram

The problem does not arise, when the sample of the data is small enough.

> 
> 
> library(gstat)
> coordinates(map) <- ~x + y
> coal.var <- variogram(value ~1, map)
> 

gstat on the other hand has no problem with a dataset of 14000 points.

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 at 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

-----Oorspronkelijk bericht-----
Van: PUJAN RAJ REGMI [mailto:regmi_pujan at hotmail.com] 
Verzonden: dinsdag 18 maart 2008 9:29
Aan: ONKELINX, Thierry; David PINAUD; r-sig-geo at stat.math.ethz.ch
Onderwerp: RE: [R-sig-Geo] Variogram Plot


Thank you very much for response.
Here i have attached the my code below . Pls have a look and suggest me
the solution.
Thanking you in advance
Yours
Pujan

mol.gr <- read.table("D:/Pujan_IUPWARE/Second_Year/Thesis/mol.dat")
mol.gr[,"x"] <-mol.gr[,1] 
mol.gr[,"y"] <-mol.gr[,2] 
mol.gr[,"Green Band Reflectance"] <-mol.gr[,3]
map<-as.geodata(mol.gr)   # make a geoR object to use various ready-made
R unctions 
coal.var <- variog(map, max.dist =283.6)   # omnidirectional
semivariogram up to half max distance
Note: The total number of data points are 14094.
_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012
008




More information about the R-sig-Geo mailing list