Fitting CTMM models for multiple individuals in a telemetry object

Skip to first unread message

Gaurav Singh-Varma

Mar 18, 2022, 1:39:02 PM3/18/22
to ctmm R user group
Hi all,

I am new to the ctmm R user group and creating AKDE's so apologies if my question does not make much sense, but I am trying to calculate AKDE's for multiple red deer individuals in a study area and I am running into issues with the function when applied to a list of ctmm objects.

For reference my code is shown below:

SJ_Norway <- red_deer_akde %>%
  filter(study_name == "Sunnfjord - Norway") %>%
  select(individual.local.identifier, timestamp, location.long,
write.csv(SJ_Norway, "SJ_Norway_akde.csv")

SJ_Norway_telem <- as.telemetry(SJ_Norway) # Converting into telemetry object
m.ouf.SJ_Norway <- lapply(SJ_Norway_telem, FUN = ctmm.guess, interactive = FALSE) # Automated model guess for each ID
M.OUF.SJ_Norway <-, m.ouf.SJ_Norway)
akde(SJ_Norway_telem, m.ouf.SJ_Norway)

I can successfully obtain automated model guesses for each ID by using lapply(), and I am using rather than since it can take a list of ctmm objects as an input. However, when I run R produces this error:

Error in colMeans(get.telemetry(data, axes)) :
  'x' must be an array of at least two dimensions

Is there anyway to calculate AKDE's for a group of individuals, rather than resorting to parsing out and calculating an AKDE for each individual?

All the help will be greatly appreciated!


Gaurav Singh-Varma

Christen Fleming

Mar 18, 2022, 3:46:47 PM3/18/22
to ctmm R user group
Hi Guarav, can take a list of guess objects, but for the purpose of attempting different candidate models or initial guesses for one individual. This is not for the purpose of analyzing multiple individuals at once. For that, you can either construct a loop or you might consider the methods in ctmmweb, which can be run from the command line.


Gaurav Singh-Varma

Mar 18, 2022, 6:16:28 PM3/18/22
to ctmm R user group
Hi Chris,

Okay that makes sense! I have had success generating AKDE's through ctmm.web so I will likely go about that route for the rest of my study areas.



Reply all
Reply to author
0 new messages