[R-sig-Geo] time slot in space-time sparse data frame (spacetime package)
edzer.pebesma at uni-muenster.de
Mon Jul 25 19:26:07 CEST 2011
Hi Jochen, thanks for your useful questions;
On 07/25/2011 06:54 PM, Jochen Albrecht wrote:
> 1. I am working with the spacetime package and have successfully ingested a
> dataset into its *irregular* space-time data frame using coordinates for
> space, an xts object for time and auxiliary data for the attribute data.
> Next I tried to create a sparse space-time data frame (i.e. a grid) using
> the same pieces of data is successfully used before, plus the additional
> index. The STSDF function choked on the xts data that I tried to provide it
> with. The documentation on the sparse space-time data frame is, excuse the
> pun, sparse.
Where exactly had you expected more information?
> There is no indication that the data structure to represent
> time is any different. The exact error message I get is:
> Error in checkSlotAssignment(object, name, value) :
> c("assignment of an object of class \"POSIXct\" is not valid for slot
> \"time\" in an object of class \"ST\"; is(value, \"xts\") is not TRUE",
> "assignment of an object of class \"POSIXt\" is not valid for slot \"time\"
> in an object of class \"ST\"; is(value, \"xts\") is not TRUE")
This is indeed a bit cryptic for non-R-developers, and we try to catch
these things and provide sth more useful. It will work in the next
spacetime release, but for now you can try, if time is your times array:
time = xts(1:length(time), time)
and pass that to STSDF (this worked, by mistake, only for STFDF and STIDF)
> 2. Unrelated to this I have a more general question of understanding. After
> creating and plotting the irregular space-time data frame, I tried to coerce
> it into a full grid, alas without success. Section 7.2 of the vignette
> illustrates how to move from a full grid to a sparse or irregular one and
> then back again. Could it be that starting with an irregular one does not
> work? I kind of would understand that because mere coercion does not provide
> all the information needed - which is why I ended up trying to create the
> gridded data frames directly (my first question).
What exactly didn't work? If you force irregular data into a grid, it
will, afaics, simply be VERY sparse...; pushed that into a full grid, it
will be VERY memory demanding.
> 3. Finally, the data that I am trying to massage are buoy paths expressed
> as a good 22 million individual space-time points. I was thinking of using
> the irregular space-time data frame structure to create the 14,855 buoy
> paths (all buoys send their location information every six hours, some buoys
> survive for up to eight years) and then to interpolate ocean current
> surfaces similar to the Irish wind example in the spacetime vignette. The
> vignette example uses full grids; will I be able to do that with the sparse
> space-time data frames because the full matrix of the full grid would
> certainly go beyond the capabilities of 'R'?
There is no "will I be able", there is only a "how will I", and the more
relevant question whether it will save you time, or cost you time,
relative to plan b -- and what plan b involves...
Are the time instances you mention aligned, or can you align them
yourself? Have you seen the vignette on proxying PostGIS tables with
Output of your analyses, or better, examples that we can reproduce make
it easier to provide helpful answers.
With best regards,
> [[alternative HTML version deleted]]
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
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