[R-sig-Geo] Space Time Irregular DF - error in managing
Edzer Pebesma
edzer.pebesma at uni-muenster.de
Wed Jul 15 18:03:57 CEST 2015
For monitoring station data, spacetime::stplot is particularly useful if
it knows that these are repeated measurements for fixed stations.
Provided with an STIDF, stplot assumes they are not. So, you may want to try
pioggieST = as(pioggieST, "STFDF")
and then try to us stplot on that object.
On 07/15/2015 05:39 PM, pierluigi de rosa wrote:
> Dear All,
>
> I have a space time data in long format. In particular I have 30 monitoring
> stations and dayly data for each monitoring station. I converted such
> dataframe using stConstruct and I created an Irregular Space time DF as I
> don't have all data for all days for each monitoring station.
> I have problem in plot this data and aggregate montly this data
> My dataframe is listed below:
>
>> head(dati_pioggie)
> nome data mm x y
> 1 Bastardo 2000-01-03 0.0 2320496 4748749
> 2 Bastardo 2000-01-04 0.0 2320496 4748749
> 3 Bastardo 2000-01-05 0.0 2320496 4748749
> 4 Bastardo 2000-01-06 0.1 2320496 4748749
> 5 Bastardo 2000-01-07 0.1 2320496 4748749
> 6 Bastardo 2000-01-08 0.0 2320496 4748749
>
>> str(dati_pioggie)
> 'data.frame': 164001 obs. of 5 variables:
> $ nome: chr "Bastardo" "Bastardo" "Bastardo" "Bastardo" ...
> $ data: Date, format: "2000-01-03" "2000-01-04" "2000-01-05" ...
> $ mm : num 0 0 0 0.1 0.1 0 0 0 0 0 ...
> $ x : num 2320496 2320496 2320496 2320496 2320496 ...
> $ y : num 4748749 4748749 4748749 4748749 4748749 ...
>
> The first column contain the measuring station name, the second the data
> (in Date format), and coords are in x and y
>
> I created the space time data frame as below:
>
>> pioggieST = stConstruct(dati_pioggie, c("x", "y"), "data", interval =
> TRUE,crs = CRS(stazioni at proj4string@projargs))
>
> If I try to analyze data or aggregate I have several problems:
>
> I I run
> stplot(pioggieST[,,"mm"]) #IT works
>
> stplot(pioggieST[,"2008-1","mm"],mode="xt") # it plot me only 6 plot but
> I'm aspecting 31 plots
>
> How can I plot a time series for all measuring station?
> How can I aggregate data montly?
>
> I tried:
>> x1 = aggregate(pioggieST[,"2008"], "month", mean)
> There were 50 or more warnings (use warnings() to see the first 50)
>> warnings()
> Messaggi di avvertimento:
> 1: In mean.default(X[[i]], ...) :
> argument is not numeric or logical: returning NA
>
> Is this an error?
>
> Thanks to all
>
> Pierluigi
>
>
>
--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster,
Heisenbergstraße 2, 48149 Münster, Germany; +49 251 83 33081
Journal of Statistical Software: http://www.jstatsoft.org/
Computers & Geosciences: http://elsevier.com/locate/cageo/
Spatial Statistics Society http://www.spatialstatistics.info
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20150715/72a8ca94/attachment.bin>
More information about the R-sig-Geo
mailing list