The following functions are provided to transform trajectories:
Function smoothTrajectories
performs multivariate smoothing on trajectory data using a Gaussian kernel.
Function centerTrajectories
shifts all trajectories to the center of the multivariate space and returns a modified distance matrix.
Function interpolateTrajectories
relocates trajectory ecological states to those corresponding to input times, via interpolation.
smoothTrajectories(
x,
survey_times = NULL,
kernel_scale = 1,
fixed_endpoints = TRUE
)centerTrajectories(x, exclude = integer(0))
interpolateTrajectories(x, times)
A modified object of class trajectories
, where distance matrix has been transformed. When calling interpolateTrajectories
, also the
number of observations and metadata is likely to be affected.
An object of class trajectories
.
A vector indicating the survey time for all surveys (if NULL
, time between consecutive surveys is considered to be one)
Scale of the Gaussian kernel, related to survey times
A logical flag to force keeping the location of trajectory endpoints unmodified
An integer vector indicating sites that are excluded from trajectory centroid computation. Note: for objects of class cycles
, external
are excluded by default.
A numeric vector indicating new observation times for trajectories. Values should be comprised between time limits of the original trajectories.
Miquel De Cáceres, CREAF
Nicolas Djeghri, UBO
Details of calculations are given in De Cáceres et al (2019).
Function centerTrajectories
performs centering of trajectories using matrix algebra as explained in Anderson (2017).
De Cáceres M, Coll L, Legendre P, Allen RB, Wiser SK, Fortin MJ, Condit R & Hubbell S. (2019). Trajectory analysis in community ecology. Ecological Monographs 89, e01350.
Anderson (2017). Permutational Multivariate Analysis of Variance (PERMANOVA). Wiley StatsRef: Statistics Reference Online. 1-15. Article ID: stat07841.
trajectoryPlot
trajectoryMetrics