[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-geo
Subject:    Re: [R-sig-Geo] creating xts object
From:       Dr._Benedikt_Gräler <b.graeler () 52north ! org>
Date:       2017-10-20 13:40:08
Message-ID: 97a41939-c888-678b-e08a-fb35e52e7df0 () 52north ! org
[Download RAW message or body]

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@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@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

["b_graeler.vcf" (text/x-vcard)]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic