Oh, right,
I actually can see that things work fine even with no "id" attribute in the
data.frame.

I started it all by following an example of Roger with NDVI images of
Gambia, where the initial wide-format dataframe was `reshape`d to
long-format to eventually create a STFDF: the ids were used there.
Afaics, one can keep trace of the spatial location of each row with the IDs
when going from a time-wide format to a long one, otherwise the spatial
dimension gets flattened with no chance of reverting to time-wide format.
Thought they were used by STFDF to link the locations in the spatial object
and the values in the data.frame.

Thanks again Edzer.
Cheers,
Piero


On 16 December 2012 19:53, Edzer Pebesma <edzer.pebesma@uni-muenster.de>wrote:

> Piero,
>
> in your case id is simply an attribute, so it can have any value, as you
> can see from:
>
> stplot(stMeuse[,,1:4], mode = 'ts')
>
> what is the special purpose of your IDs, what should they identify?
>
> On 12/16/2012 07:42 PM, Piero Campalani wrote:
> > Thank you Edzer,
> > comments inline
> >
> > On 16 December 2012 19:19, Edzer Pebesma <edzer.pebesma@uni-muenster.de
> >wrote:
> >>
> >> Yes, that works:
> >>
> >>> class(stMeuse)
> >> [1] "STFDF"
> >> attr(,"package")
> >> [1] "spacetime"
> >>> dim(stMeuse)
> >>     space      time variables
> >>        10         2         4
> >>
> >
> > I could see that a STFDF object was created, but I still have some
> concern
> > with regard to the "id" which need to be attached to the data.frame .
> >
> > With regards to my example, I tried as well with reverse-order IDs:
> >> ds <- cbind(ds, time=sort(rep(dts,10)), id=nrow(ds):1)
> > ...or with duplicated IDs like:
> >> ds <- cbind(ds, time=sort(rep(dts,10)), id=rep(1:10,2))
> > and the final stMeuse object still seemed the same by looking at
> > stplot(stMeuse).
> > I guess they are not bound to the locations of the spatial object (points
> > in `meuse` in this case).
> >
> >
> >> (also note that with the CRAN version of spacetime, you'd need to load
> >
> > package zoo first in order to run your script)
> >>
> >
> > Got it, thanks ;)
> >
> > Piero
> >
>
> --
> 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@wwu.de
>
>

	[[alternative HTML version deleted]]

