Learn R Programming

BioTrajectory (version 1.1.0)

trimTrajectory: Trim a trajectory object to a subset of points

Description

This function trims the points of a `trajectory` object by selecting a subset of the points from the specified `from` to `to` indices. It then creates a new trajectory using the selected points.

Usage

trimTrajectory(obj, from = 1, to = nrow(obj$points))

Value

A new trajectory object created using the subset of points from the `from` to `to` indices.

Arguments

obj

An object of class `trajectory` that contains a component `points`, which is a data frame with the coordinates of the points in the trajectory.

from

A positive integer indicating the starting index of the points to include. Default is 1.

to

A positive integer indicating the ending index of the points to include. Default is the total number of rows in `obj$points`.