Learn R Programming

BioTrajectory (version 1.1.0)

subsampleTrajectory: 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)

Value

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

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.