Skip to content
Prev 17977 / 29559 Next

STSDF construct

Saman,

Your time is not ordered, which the error message suggest (but the
documentation not clearly states) so I tried:

o = order(data$time)
x = STSDF(pts,data$time[o], data[o,], ind[o,])

but this results in another error, which indicated that data$time has
duplicate values, which is not supposed to be the case.

I tried then to add x and y to data, but

match(data$location, cancer.loc$locaation)

gives NA values, so not all locations can be matched.

data$x = cancer.loc[m, "x"]
data$y = cancer.loc[m, "y"]

gives you the long table with coordinates (some of them missing, due to
mismatching names);

x = stConstruct(na.omit(data), c("x", "y") ,"time")
x2 = as(x, "STSDF")

Thanks for providing a small reproducible example.
On 04/10/2013 10:32 AM, Saman Monfared wrote: