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

Paul Hiemstra p.hiemstra at geo.uu.nl
Tue Nov 3 09:53:06 CET 2009


Hi Eduardo,

Please also take a look at the archive of r-sig-geo, there are earlier 
questions that have been answered on variograms in plots:

http://www.mail-archive.com/r-sig-geo@stat.math.ethz.ch/msg05795.html

cheers,
Paul

Edzer Pebesma wrote:
> 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.
>>
>>   
>>     
>
>   


-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone:  +3130 274 3113 Mon-Tue
Phone:  +3130 253 5773 Wed-Fri
http://intamap.geo.uu.nl/~paul



More information about the R-sig-Geo mailing list