[R-sig-Geo] creating xts object

Dr. Benedikt Gräler b.graeler at 52north.org
Fri Oct 20 15:40:08 CEST 2017


I tried to re-build the issue with a small toy example (see below). Like 
you, I also observe that the "timelag" column only denotes Jan 0000. But 
this is due to the fact that yearmon of "0" difference is Jan 0000. 
Checking also the values of empVgm and the wireframe plot indicates that 
sensible temporal differences have been calculated in this toy example 
(multiples of the fraction 1/12: yearmon(0/12) = Jan 0000, yearmon(1/12) 
= Feb 0000, ...). I suggest to also double check your empirical 
spatiotemporal variogram.

HTH,

  Ben

-/R-Script/-

library(xts)
library(spacetime)
library(gstat)

stfdf <- STFDF(SpatialPoints(cbind(runif(10), runif(10))),
                yearmon(x = 0:23/12+2015),
                data.frame(var=rnorm(10*24)))

empVgm <- variogramST(var~1, stfdf, tlags = 0:5, boundaries = 1:5/10)
empVgm
plot(empVgm, wireframe=T, scales=list(arrows=F))

spEmpVgm <- empVgm[empVgm$timelag == 0, ]
class(spEmpVgm) <- c("gstatVariogram", "data.frame")
spEmpVgm
plot(spEmpVgm)

yearmon(0)




On 16/10/2017 17:59, Mahsa Sameti wrote:
> Dear all
> 
> I’m working with monthly spatio-temporal data. I have a question about
> creating spatio-temporal object.
> 
> When I wanted to create time series, I used as.yearmon function. After that
> when i create purely spatial variogram from empirical spatio-temporal
> variogram (spEmpVgm <- empVgm[empVgm$timelag == 0,]) , it shows only
> January in time lag==0. Is it true or not?
> 
> Should I change the method of creating xts object?
> 
> 
> Thanks alot
> 
> 	[[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
> 

-- 
Dr. Benedikt Gräler
52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Muenster, Germany

E-Mail: b.graeler at 52north.org
Fon: +49-(0)-251/396371-39
Fax: +49-(0)-251/396371-11

http://52north.org/
Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849
-------------- next part --------------
A non-text attachment was scrubbed...
Name: b_graeler.vcf
Type: text/x-vcard
Size: 445 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20171020/d38275b3/attachment.vcf>


More information about the R-sig-Geo mailing list