[R-sig-Geo] plot only cross variogram in gstat

Edzer Pebesma edzer.pebesma at uni-muenster.de
Sun Oct 28 17:07:54 CET 2012


plot(meuse.g.var[meuse.g.var$id == "zn.cu",], meuse.g.fit$model[[2]])

On 10/28/2012 12:49 AM, Collins, Douglas Parker wrote:
> Hi All,
> 
> I'm trying to show two cross variograms and their fitted models side-by-side.  Models and variograms are produced with the gstat function fit.lmc.  I would like to do this without also showing the single variograms.  I'm not very familiar with lattice or gstat, and I'm stuck.  What I would like to do from the following data set would be to produce a plot of only the zn.cu graph.  If someone could demonstrate how to do this, I think I would be able to take it from there.
> 
> 
> data(meuse)
> coordinates(meuse)=~x+y
> data(meuse.grid)
> gridded(meuse.grid)=~x+y
> meuse.g <- gstat(id = "zn", formula = log(zinc) ~ + 1, data = meuse, nmax = 10)
> meuse.g <- gstat(meuse.g, "cu", log(copper) ~ 1, meuse, nmax = 10)
> meuse.g <- gstat(meuse.g, model = vgm(1, "Sph", 900, + 1), fill.all = T)
> meuse.g
> meuse.g.var<- variogram(meuse.g, cutoff = 1000)
> plot(meuse.g.var)
> names(meuse.g)
> meuse.g.fit<-fit.lmc(meuse.g.var, meuse.g)
> plot(meuse.g.var, model=meuse.g.fit)
> 
> 
> I get close to what I want with this extra line:
> plot(meuse.g.var, subset=id=="zn.cu", meuse.g.fit)
> 
> but xyplot is still providing space for the other plots.  Not sure how to create just the single zn.cu plot.
> 
> Thanks,
> 
> Doug Collins
> Small Farms Extension Specialist
> Washington State University
> Center for Sustaining Agriculture and Natural Resources
> 2606 W Pioneer
> Puyallup, WA  98371
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      e.pebesma at wwu.de



More information about the R-sig-Geo mailing list