pennekampster / MSSI

Implements the MSSI measure for animal trajectory analysis proposed by Postlethwaite et al. 2013 in R
2 stars 3 forks source link

Error using a granulosity >1 #2

Open abfleishman opened 8 years ago

abfleishman commented 8 years ago

I am trying to use your function to look at MSSI for seabird tracks. points are generally 1-3 minutes apart. I tryed to use a POSIXct object in the time argument an d it would not work so I converted it to a numeric (which seems to work) but now I can't change the granulosity to any other value than 1. Thoughts?

mm<-calculate_MSSI(data = mmm,uniqueID = "CaptureID",time = "Time",window_size = 2:10,granulosity = 5)

Error in $<-.data.frame(*tmp*, "granulosity", value = 5) : replacement has 1 row, data has 0

pennekampster commented 8 years ago

Hi, thanks for your message. Could you send me a short snippet of your data to test (by email if you prefer)? I have no strong candidate for the problem for the moment, other than that the package does not work on the time stamp but the number of rows (for window size) and hence assumes equal length intervals. You seem to be able to get the output for granulosity 1 though, no?

dwwolfson commented 8 years ago

Any progress on the earlier comment? I'm getting the same error message although I have a granulosity of 1. I'll email you my code and data.

pennekampster commented 8 years ago

The problem is the time column. As it stands, the time has to be provided as a sequence . Each fix is hence a integer number, from 1 to last observation, for each of the individuals in the dataset. Hope this helps.