Hi Chris (or anyone else who can help),
I have a large data set of 40+ seaturtles for which I want to calculate AKDEs. Currently I'm doing so using lapply to calculate all of them in one go. AS this takes forever, I would like to put my code into a 'foreach' loop, which you metioned in your last webinar would speed-up the process as thhis funtion would use all cores (?).
I have never used foreach before and would appreciate if someone could help me to set it up.
Here's my current code:
# fit models for all animals
GUESS <- lapply(turtle.trj, function(b) ctmm.guess(b, CTMM = ctmm(error = 10), interactive=FALSE) )
FITS <- lapply(1:length(turtle.trj), function(i) ctmm.select(turtle.trj[[i]],GUESS[[i]], verbose=F, trace = TRUE, cores = 2))
names(FITS) <- names(turtle.trj)
UDS <- akde(turtle.trj, FITS, grid=list(dr=500, align.to.origin=T), weights=F)
Cheers,
Ingo