interpolateTrajectory: Interpolates a trajectory

View source: R/interpolateTrajectory.R

interpolateTrajectoryR Documentation

Interpolates a trajectory

Description

Given a dataset of points, it interpolates to generate intermediate points between them.

Usage

interpolateTrajectory(data, n = 4)

Arguments

data

A data frame with at least two columns: 'x' and 'y', representing the coordinates of the points.

n

An integer indicating the number of intermediate points to generate between each pair of points. Default is 4.

Value

A data frame containing the 'x' and 'y' coordinates, which includes both the original points and the interpolated points.

Examples

# Create an example data frame
data <- data.frame(x = c(1, 2, 3), y = c(1, 4, 9))
# Interpolate the trajectory
interpolated <- interpolateTrajectory(data, n = 4)
print(interpolated)

BioTrajectory documentation built on June 8, 2025, 11:54 a.m.