[R-sig-Geo] Spatiotemporal inquiry

Edzer Pebesma edzer.pebesma at uni-muenster.de
Mon Feb 25 15:40:52 CET 2013



On 02/25/2013 02:24 PM, ping yang wrote:
> Dear R,
>
> I have a question for conducting a spatio-temporal inquiry, suppose I have
> a time series of air temperature data for 100 years for my domain, can I
> perform a inquiry like this " *How many days are there temperature above 40
> degree *(CC) and get all these days", I noticed there are evolving
> discussion on the space-time library, Have anyone already done this? or Any
> suggestions will be appreciated.

assuming you have regular time series for a limited number of weather 
stations, then your question is similar to asking for the wind data set 
how many days the wind speed exceeded e.g. the value of 19:

library(spacetime)
example(stConstruct)
sel = which(apply(as(wind.st, "xts"), 1, function(x) any(x > 19)))
length(sel)
# how many: 2416
unique(index(wind.st[,sel]))
# which dates: "1961-01-10 GMT" "1961-01-11 GMT" "1961-01-12 GMT" etc.

note that we're essentially counting rows in a matrix with some value(s) 
larger than 19 here -- seeing the thing as a multivariate time series, 
meaning you could do all this with xts or zoo alone.

>
> Thanks,
>
> Ping
>
> 	[[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