Telemetry Error Vingette: subscript out of bounds

59 views
Skip to first unread message

Haley Jones

unread,
Jul 9, 2022, 11:36:35 AM7/9/22
to ctmm R user group
Hello all, I am a relatively new R user, so I apologize if my request for help is an obviously easy fix. 

I am trying to use the telemetry error vignette to estimate the error of a stationary GPS collar that I deployed for a few weeks. I originally was having issues with the POSIXIT date, but I seemed to figure that out. I was also having issues with ensuring my data frame was titled the correct way for the ctmm package.

Here are the exact titles I used for my columns: 
individual.local.identifier
location.lat
location.long
timestamp
eobs.horizontal.accuracy.estimate

Here is the timestamp form in case this is the issue:  5/23/2022 16:00

Here is my code:
GPSe <- read.csv("C:/Users/haley/OneDrive/Desktop/Collarfix.csv")
?as.telemetry
GPSe <- as.telemetry(GPSe, timeformat = "%y/%j %H:%M",timezone="GMT") 

And here is the error I receive with the GPSe line:
Error in `[<-`(`*tmp*`, "all", "horizontal", value = median(CAL)) : subscript out of bounds

Thank you so much for your help online community!

Christen Fleming

unread,
Jul 10, 2022, 6:49:57 AM7/10/22
to ctmm R user group
Hi Haley,

That timestamp format looks like "%m/%d/%Y %H:%M" to me. In general, you can also try your luck with "auto", which will use parsedate.

Best,
Chris

Haley Jones

unread,
Jul 10, 2022, 9:04:40 PM7/10/22
to ctmm R user group
Hi Chris, 
Thank you, that fixed it! I did not get a follow up error, but I received this result: Minimum sampling interval of 2 hours in 1. 

My sampling interval was once every 15 minutes. Would I be able to use all of this data, or do you recommend I omit all data between the two-hour period?

Thank you for your help,
Haley

Christen Fleming

unread,
Jul 10, 2022, 10:35:34 PM7/10/22
to ctmm R user group
Hi Haley,

If your sampling interval was really 15 minutes, but as.telemetry says that 2 hours is the smallest interval in individual "1", then I would check the data and its formatting. Maybe the data aren't formatted correctly or maybe that one collar/tag malfunctioned and only took fixes every 2 hours. I can take a look if the data are correct but aren't importing correctly.

Best,
Chris
Reply all
Reply to author
Forward
0 new messages