[R-sig-Geo] Ploting objects of class 'STT' with stplot

Edzer Pebesma edzer.pebesma at uni-muenster.de
Thu Sep 11 23:33:36 CEST 2014



On 09/11/2014 09:04 PM, Daniel Teixeira dos Santos wrote:
> Hello,
> 
> I am beginning with spacetime and just tried some examples of code with it.
> I have tried to plot an object of class 'STT' and got this error message:
> 
> 
>> stplot(stt)
> Erro em (function (classes, fdef, mtable)  :
>   unable to find an inherited method for function ‘stplot’ for signature
> ‘"STT"’
> 
> 
> The code I've used to create the 'stt' object is the same example code of
> the documentation for "STT" class:
> 
> 
> library(spacetime)
> library(sp)
> m = 3# nr of trajectories
> n = 100 # length of each
> l = vector("list", m)
> t0 = as.POSIXct("2013-05-05",tz="GMT")
> set.seed(1331) # fix randomness
> for (i in 1:m) {
> x = cumsum(rnorm(n))
> y = cumsum(rnorm(n))
> sp = SpatialPoints(cbind(x,y))
> #t = t0 + (0:(n-1) + (i-1)*n) * 60
> t = t0 + (0:(n-1) + (i-1)*n/2) * 60
> l[[i]] = STI(sp, t)
> }
> stt= STT(l)
> sttdf = STTDF(stt, data.frame(attr = rnorm(n*m), id = paste("ID", rep(1:m,
> each=n))))
> 
> 
> Isn't it supposed to have a method for plotting "STT" objects?

yes, this is a bug, fixed on github. It will however give you the same as

stplot(sttdf)

which is rather primitive too.

FYI, there is now a package called trajectories on CRAN, which has more
useful plotting methods for trajectory data. I think it does a better
job representing trajectories, and I hope to see future development
there rather than in spacetime.

Thanks for the clear report,

> 
> 
> --
> Daniel Teixeira dos Santos
> Mestrando em Computação Aplicada (INPE)
> Bacharel em Ciência da Computação (UFLA)
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Heisenbergstraße 2, 48149 Münster, Germany. Phone: +49 251
83 33081 http://ifgi.uni-muenster.de GPG key ID 0xAC227795

-------------- 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/20140911/bb3ffd84/attachment.bin>


More information about the R-sig-Geo mailing list