[R-sig-Geo] Res: Problem with points.geodata and plot.geodata

Rubén Roa-Ureta rroa at udec.cl
Mon Oct 20 16:05:47 CEST 2008


Gledson Picharski wrote:
> Hi Rubén,
>
> Try this,
>
> my.func <- set.coords.lims #if you want this geoR function latter.
> set.coords.lims <-function(coords)apply(coords,2,range) 
> plot(z1)
> points(z1,pt.divide=c("data.proportional"),lambda=1,col="gray",yl="",xl="")
>
> ## to get set.coords.lims back.
> set.coords.lims <- my.func
> plot(z1)
>
>  
>
> ______________________
> Gledson Luiz Pichasrki
> PET Estatística - UFPR
> http://www.leg.ufpr.br/~gledson
> http://www.leg.ufpr.br/pet
>
>
>
>
> ----- Mensagem original ----
> De: Rubén Roa-Ureta <rroa at udec.cl>
> Para: r-sig-geo at stat.math.ethz.ch
> Enviadas: Domingo, 19 de Outubro de 2008 21:11:48
> Assunto: [R-sig-Geo] Problem with points.geodata and plot.geodata
>
> Hi ComRades,
>
> The functions points.geoadata and plot.geodata have an underisable 
> behavior with the limits of the X axis of the plot, as shown by the toy 
> example below. The range covered by the X axis is too wide. Setting 
> specific limits with xlim in, for example points.geoadata, doesn't solve 
> the problem.
> Does anybody knows of a solution or a way around this feature.
> Thanks
> Rubén
>
> x <- runif(100,100,200)
> y <- runif(length(x),1000,2000)
> z <- rnorm(length(x),50,15)
> a <- sample(c(1,2),length(x),replace=TRUE)
> Q <- data.frame(cbind(x,y,z,a))
> z1 <- subset(Q,a==1,select=c(x,y,z))
> 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-22 (built on 2008-10-08) is now loaded
> #-------------------------------------------------------------
> z1 <- as.geodata(z1)
> plot(z1)
> points(z1,pt.divide=c("data.proportional"),lambda=1,col="gray",yl="",xl="")
>   
Thanks Gledson. Your fuction method works for plot.geodata and 
points.geodata. I also wanted to make it work with image.kriging but it 
doesn't.
My general idea is that a good representation of model fit to data in 
the case of a geostatistical model is a two-panel plot showing the 
observation points on one panel (with size or color or both proportional 
to the magnitude of the spatial variable) and the spatial prediction by 
kriging with the fitted model on the other panel (like my Fig. 4 in ICES 
Journal of Marine Science 64:1723, 2007), but this presentation has 
problems when the spatial sample layout is elongated because it makes 
too much blank space, for the good reasons explained by Barry.
Rubén




More information about the R-sig-Geo mailing list