View source: R/showTrajectory.R
showTrajectory | R Documentation |
Visualizes the trajectory represented by a series of points. The function can display the full trajectory or a subset based on a specified step size. It supports customizable color palettes for enhanced visualization.
showTrajectory(data, stepSize = 0, pal)
data |
A data frame containing the trajectory coordinates with columns 'x' and 'y'. |
stepSize |
An integer specifying the interval for plotting segments of the trajectory. If set to 0, the entire trajectory is plotted. Default is 0. |
pal |
A color palette to be used for plotting the trajectory segments. |
A plot displaying the trajectory based on the provided coordinates and settings.
# Generate example trajectory data
path <- system.file('extdata/track.txt', package='BioTrajectory')
data <- BioTrajectory::readtrackData(path)
data <- na.omit(data)
palette <- grDevices::colorRampPalette(c("purple","blue","cyan","yellow","orange","red"))
# Show the full trajectory
showTrajectory(data, stepSize = 0, pal = palette)
# Show the trajectory with a step size of 36
showTrajectory(data, stepSize = 36, pal = palette)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.