pad.trajectory: Regularize irregular trajects and/or subsample trajects

Description Usage Arguments Value Author(s) Examples

View source: R/pad.trajectory_function.R

Description

pad.trajectory takes a matrix of locations associated to a vector of times at which these locations were acquired, and return a pseudo-regular times-series of locations filled with NAs when no locations were acquired within a duration tol from an expected time. When several locations were acquired within the duration tol, only the closest in time from the expected time of acquisition is kept. Because of the way it does the job it will also keep only one of several duplicates. This function was made because it seems that setNA and sett0 in adehabitatLT want ALL acquired locations to be in the output trajectory - this is problematic for some tracks which were very irregulars. Note that this function can be useful to subsample trajectories.

Usage

1
2
3
pad.trajectory(xy, time, date.ref, dt, tol, correction.xy = c("none", "cs"),
  returnltraj = FALSE, idtraj = NULL, bursttraj = NULL, Index = NULL,
  max_sampling = NULL)

Arguments

xy

matrix of locations

date.ref

a POSIXct object defining the date/time at which the output trajectory should start

dt

the duration (minutes) of the interval between two locations.

tol

the tolerance (minutes) within which a acquired location is close enough to be kept for locating the animal at an expected time

correction.xy,

none if the real times of acquired locations should be kept, cs if the output trajectory should be made regular (see above)

returnltraj

should the function return a ltraj object rather than a data frame

idtraj

the id that will be used to identify the ltraj object

bursttraj

the burst used to identify the ltraj object

Index

corresponding to the line in the original dataframe i.e. used afterwards to retrieve other attributes from the original data.

max_sampling

if you want not to calculate all time differences

Value

a dataframe or ltraj object with theoretical hour of acquisition and real location.

Author(s)

Simon Chamaille-Jammes, simon.chamaille@cefe.cnrs.fr

Examples

1
pad.trajectory(xy,time,date.ref,dt,tol,correction.xy="cs",returnltraj=TRUE,idtraj="Zebra12",bursttraj="Zebra12_1h",Index)

rpatin/gpstools documentation built on Sept. 25, 2021, 7:47 a.m.