Alternative to using Movebank

100 views
Skip to first unread message

Kushaal Selvarajah

unread,
Jun 28, 2023, 5:25:20 AM6/28/23
to ctmm R user group
Hi Chris,

I am currently using the ctmm package.
However, I keep running into the same error code and fail to find a solution.

> serow <- as.telemetry(df, timezone="UTC") Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format

Alternatively, is it possible to replicate our own data to that of Movebank format without having to upload it onto the site?

Thank you for your time.

Jesse Alston

unread,
Jun 28, 2023, 12:02:55 PM6/28/23
to Kushaal Selvarajah, ctmm R user group
Hi Kushaal,

Yes, you can just rename the important headers of your data (lat-long, timestamp, individual.local.identifier, etc) to the same conventions as MoveBank. But it's often not necessary--Chris has coded things up so that it automatically recognizes almost all commonly used column headers.

Your error here is because your timestamp column is a character vector that is not automatically convertible into a timestamp by ctmm. You can use as.POSIXlt() or as.POSIXct() to fix this. If you have trouble doing this, you can send me a subset of your data (e.g., the top 10 or so rows) and I can send you code to fix it.

Jesse

--
You received this message because you are subscribed to the Google Groups "ctmm R user group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ctmm-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ctmm-user/754fc3aa-8b20-4abf-822e-83d5c9589c38n%40googlegroups.com.


--

Christen Fleming

unread,
Jun 28, 2023, 2:13:23 PM6/28/23
to ctmm R user group
Hi Kushaal,

You can try your luck with timeformat="auto" or provide timeformat argument for the non-POSIX format that your timestamps are in: see help('as.telemetry')

Best,
Chris

Kushaal Selvarajah

unread,
Jun 28, 2023, 11:45:13 PM6/28/23
to ctmm R user group
Thank you Jesse and Chris,

I have made progress! Your advice helped. However, I am running into a new problem. I keep getting the below error when I attempt to produce a variogram.

> vg.cilla<-variogram(serow) Error in rep(0, nrow(data)) : invalid 'times' argument

Below is my current script and how my data frame looks like before converting into as.telemetry;

df <- read.csv("C:/Users/Kushaal/Downloads/serow_trial2a.csv"
               , stringsAsFactors = FALSE)

df$timestamp <- as.POSIXct(df$timestamp, tz = "UTC", format = "%Y-%m-%d %H:%M:%OS")


serow <- as.telemetry(df, timezone="UTC")

#Plotthepositions
plot(serow)

#Calculatevariogram
vg.serow<-variogram(serow)

DF screenshot.png

Could there be an error still in my timestamp? Sorry I am fairly new to this field.

Jesse Alston

unread,
Jun 28, 2023, 11:56:25 PM6/28/23
to Kushaal Selvarajah, ctmm R user group
Hi Kushaal,

Your individual.local.identifier should be the same across each individual. It looks like you imported the unique location ID in this column, so your telemetry object is only one row long.

Jesse

--
You received this message because you are subscribed to the Google Groups "ctmm R user group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ctmm-user+...@googlegroups.com.

Kushaal Selvarajah

unread,
Jun 29, 2023, 1:04:25 AM6/29/23
to ctmm R user group
Thank you for the help! It works now.
Reply all
Reply to author
Forward
0 new messages