Dear list,

I have been trying to find a way to segment (split) ltraj into regular
bursts according to a temporal window (i.e. bursts containing 10 days of
relocations).

The conceptual way I thought to implement this was to 1) extract the start
date and end date from the ltraj summary list for each burst (bursts have
varying start and end dates), 2)  for each of these vectors create a
sequence (seq) using start and end dates and defining a 10 day interval, 3)
use this to in conjunction with cutltraj to cut ltraj into 10 day segments.

I have not succeed in implementing this but below a reproducible example
taken from the LT package and the steps as outlined. Any suggestions or
pointers much appreciated.

install.packages("adehabitatLT")
data(capreochiz)
ltr1<- as.ltraj(xy = capreochiz[,c("x","y")],
                date = capreochiz$date,
                id = "Roe.Deer", typeII = TRUE,
                infolocs = capreochiz[,4:8])

sum<-summary(ltr1)

#extracting the min and max dates per burst (in this example
#only one but often many bursts per ltraj. Ideally bound.dates
#should round date.start and date.end up or down to the start of #the
day and end of the day

bound.dates <- seq(min(sum$date.begin)-1,max(sum$date.end)+1,by="day")

#Below ideally what I would like to do but obviously not working

#as "bound.dates" not a logical expression. How could one
#be constructed?

cltr1<-cutltraj(ltr1,"bound.dates",nextr=TRUE)

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

Reply via email to