View source: R/interpolateTrajectory.R
interpolateTrajectory | R Documentation |
Given a dataset of points, it interpolates to generate intermediate points between them.
interpolateTrajectory(data, n = 4)
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. |
A data frame containing the 'x' and 'y' coordinates, which includes both the original points and the interpolated points.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.