[R-sig-Geo] Various Variograms of gstat package together in a single page

Edzer Pebesma edzer.pebesma at uni-muenster.de
Tue Nov 3 08:08:32 CET 2009


Eduardo Bustos wrote:
> Dear List:
>
> I need  your help. I'm a new user in R ( round two weeks...) and I'm trying
> to make several interpolations in R with Gstat package.
>
> Initially, I have a workbook in MSExcel, with several sheets, which were
> imported using xlsReadWrite package in a list in R (45 data frame in one
> object (class=list))
>
>   
>> d <- as.list(length(z))
>> for (i in 1:length(z))
>>     
> +d[[i]] <- read.xls('Tablas_puntos.xls', colNames=TRUE, sheet = i)
>
> Later, the data frames were convert to explicity-spatial,using the sp
> package (I have followed the instructions of the tecnical note of D.G
> Rossiter --> http://www.itc.nl/~rossiter/teach/R/R_ck.pdf).
>
> Finally, I create an object (list) with 45 variograms for each one of the
> data sets.
>
>   
>> v.d.temp <- as.list(length(z))
>> for(i in 1:length(z))
>>     
> +v.d.temp[[i]] <- variogram(TempC ~1, data= d.temp[[i]], cutoff=25000,
> width=200)
>
> At this point, everything works OK:
>
>  - The final question: How to putt several of these variogram graphics
> together in a single page ?
>
> I tried with par(mfrow=c(n,m)) in  together with loops (see code below), but
> it didn't work.....or I don't know how....and I`ve read the subjects about
> this topic in this mail list (and the answers of Ezder Pebesma), but I stil
> cannot make it work.
>
>   
>> par(mfrow=c(2,2))
>> for (i in 1:4)
>>     
> +print (plot ( v.d.temp [ [ i ] ]   ) )
>   
Untried:

par(mfrow=c(2,2))
for (i in 1:4) {
  v = v.d.temp[[i]]
 
plot(gamma~dist,v,xlim=c(0,max(v$dist)),ylim=c(0,max(v$gamma),xlab="distance",
ylab="semivariance")
}
> In advance, thank you very much.
>
> Eduardo.
>
>   

-- 
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.springer.com/978-0-387-78170-9 e.pebesma at wwu.de



More information about the R-sig-Geo mailing list