Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

issues getting AKDE home ranges sizes from a for loop

53 views
Skip to first unread message

Talesha Karish

unread,
Dec 21, 2024, 4:53:13 PM12/21/24
to ctmm R user group

Hi Everyone

I am having issues extracting the area of the home ranges of the individuals in a for loop.

I can plot the home ranges from the code and get the metadata out of the code.  But I cant get a list of the sizes of the home ranges.   

deer <- read.csv("test.csv")

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

 doe<-as.telemetry(deer)

 FITS <- AKDES <- list()

 for(i in 1:length(doe))

 {

   GUESS <- ctmm.guess(doe[[i]],interactive=FALSE)

   # use ctmm.select unless you are certain that the selected model is OUF

   FITS[[i]] <- ctmm.fit(doe[[i]],GUESS)

 }

 AKDES <- akde(doe,FITS)

COL <- color(AKDES,by='individual')

 plot(AKDES,col.DF=COL,col.level=COL,col.grid=NA,level=NA)

 meta(AKDES,col=c(COL,'black'),sort=TRUE)


summary(AKDES)

 it gives me an error of

Error in if (type %nin% c("range", "revisitation")) { :

argument is of length zero

 

 The home range size on the graph looks correct but how do I extract  the 95%  home ranges.  To make it more complicated I also have to extract  50% home ranges. 

Everything I saw says just to use summary()  but its not working for me. What am I missing?

Thank you

Talesha

test.csv

Christen Fleming

unread,
Jan 17, 2025, 10:56:20 AMJan 17
to ctmm R user group
Hi Talesha,

summary() is so far only defined on individual UDs, so you could do something like sapply(AKDES,function(ud){summary(ud,units=FALSE,level.UD=0.95)})

and then change the coverage probability to what you want.

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