Fitting CTMM models for multiple individuals in a telemetry object

220 megtekintés
Ugrás az első olvasatlan üzenetre

Gaurav Singh-Varma

olvasatlan,
2022. márc. 18. 13:39:022022. 03. 18.
– 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 ctmm.select() 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, location.lat)
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 <- ctmm.select(SJ_Norway_telem, 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 ctmm.select() rather than ctmm.fit() since it can take a list of ctmm objects as an input. However, when I run ctmm.select() 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!

Best,

Gaurav Singh-Varma

Christen Fleming

olvasatlan,
2022. márc. 18. 15:46:472022. 03. 18.
– ctmm R user group
Hi Guarav,

ctmm.select 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.

Best,
Chris

Gaurav Singh-Varma

olvasatlan,
2022. márc. 18. 18:16:282022. 03. 18.
– 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.

Cheers,

Gaurav

Válasz mindenkinek
Válasz a szerzőnek
Továbbítás
0 új üzenet