# NOT RUN {
#######################################################
##
## GPS monitoring of one bear
data(bear)
## We want to study the trajectory of the day at the scale
## of the day. We define one trajectory per day. The trajectory should begin
## at 22H00
## The following function returns TRUE if the date is comprised between
## 21H00 and 22H00 (i.e. correspond to the relocation taken at 21H30)
foo <- function(date) {
da <- as.POSIXlt(date, "GMT")
ho <- da$hour + da$min/60
return(ho>21&ho<22)
}
## We cut the trajectory into bursts after the relocation taken at 21H30:
bea1 <- cutltraj(bear, "foo(date)", nextr = TRUE)
bea1
## Remove the first and last burst:
bea2 <- bea1[-c(1,length(bea1))]
#######################################################
##
## Bind the trajectories
bea3 <- bindltraj(bea2)
bea3
# }
Run the code above in your browser using DataLab