If you don't have every time value at every spatial point, then you can't
have an STFDF object, as by definition STFDF is a full space by time grid.
 The equation in the error is part of the definition/requirement for an
STFDF object.

SDIDF objects don't have that requirement of all times at all locations.
 Depending on the function you use for kriging and what exactly you are
attempting to estimate via kriging, you may or may not be able to use SDIDF
objects instead of SDFDF objects.

Tom


On Mon, Aug 26, 2013 at 11:11 AM, Supadog <zdziarze@scss.tcd.ie> wrote:

> Hello,
>
> I'm having trouble creating an STFDF object from my spacio-temporal data.
> The object is intended to be used later to perform kriging interpolation.
> My data looks like this (a few lines):
>       x    y   t            value
> 1    30   30 497826   6.6
> 2   960   30 499430   7.4
> 3  1890  30 500990   59.8
>
> And I type in the following commands:
> # read in the data from csv file and specify coordinates columns
> f <- read.csv('data.csv')
> coordinates(f) <- ~x+y
>
> # create SP object out of the coordinates
> g <- as(f, "SpatialPoints")
>
> # obtain time points. The timestamps are in milliseconds.
> ts = f$t
> options("digits.secs"=3)
> time = as.POSIXct(ts/1e3, origin="1970-01-01", tz="Europe/Dublin")
>
> # create data.frame
> data = as.data.frame(f[2])
>
> # finally create the STFDF object
> obj = STFDF(g, time, data)
>
> But I get the following error message:
> Error: nrow(object@data) == length(object@sp) * nrow(object@time) is not
> TRUE
>
>
> What am I missing? The data is in long form so each time reading has its
> own
> coords and data value and I don't want the equation in the error to hold.
>
>
>
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/Error-with-STFDF-tp7584461.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

