edzer / trajectories

Handling and analyzing trajectory and movement data
31 stars 15 forks source link

Function Kinhom.Track produces error "Error in as.data.frame.default(x[[i]], optional = TRUE) : cannot coerce class ‘structure("Track", package = "trajectories")’ to a data.frame" #24

Closed VjeraTurk closed 5 years ago

VjeraTurk commented 5 years ago

Examples for function Kinhom.Track from R documentation and article produce the same error.

Example from documentation:

library(spatstat)
X <- list()
for(i in 1:100){
  m <- matrix(c(0,10,0,10),nrow=2,byrow = TRUE)
  X[[i]] <- rTrack(bbox = m,transform = TRUE)
}
Kinhom.Track(X,timestamp = "180 secs")

Code chunk number 21: article

K <- Kinhom.Track(Beijing, timestamp = "20 mins", correction = "translate", q=0)

Error:

Error in as.data.frame.default(x[[i]], optional = TRUE) : 
  cannot coerce class ‘structure("Track", package = "trajectories")’ to a data.frame

I was following your article and got stuck at Kinhom.Track function. I apologise if the issue is on my side, and will appreciate any help with resolving it regardless.

VjeraTurk commented 5 years ago

Things resolved on their own after restarting RStudio. Sorry to bother you.