#########################################################################
##
##
## Transform a GPS monitoring on 4 ibex into a regular trajectory
##
data(ibexraw)
is.regular(ibexraw)
## the data are not regular: see the distribution of dt (in hours)
## according to the date
plotltr(ibexraw, "dt/3600")
## The relocations have been collected every 4 hours, and there are some
## missing data
## The reference date: the hour should be exact (i.e. minutes=0):
refda <- strptime("00:00", "%H:%M")
refda
## Set the missing values
ib2 <- setNA(ibexraw, refda, 4, units = "hour")
## now, look at dt for the bursts:
plotltr(ib2, "dt")
## dt is nearly regular: round the date:
ib3 <- sett0(ib2, refda, 4, units = "hour")
plotltr(ib3, "dt")
is.regular(ib3)
## ib3 is now regular
Run the code above in your browser using DataLab