subsampleTrajectory: Subsample the points of a trajectory object and create a new...

View source: R/subsampleTrajectory.R

subsampleTrajectoryR Documentation

Subsample the points of a trajectory object and create a new trajectory

Description

This function subsamples the points of a 'trajectory' object by selecting every 'step'-th point. It then creates a new trajectory using the selected points, adjusting the 'delta_time' accordingly.

Usage

subsampleTrajectory(obj, step = 2)

Arguments

obj

An object of class 'trajectory' that contains a component 'points'. The 'points' component must have columns 'x' and 'y' representing the trajectory coordinates.

step

A positive integer that defines the step size for subsampling the points. Default is '2', meaning every second point will be selected.

Value

A new trajectory object created using the subsampled points and the adjusted 'delta_time'.


BioTrajectory documentation built on Nov. 26, 2025, 5:07 p.m.