TrajFromTrjPoints | R Documentation |
Creates a trajectory from a subset of the points in another trajectory, preserving metadata and all columns in the original trajectory.
TrajFromTrjPoints(trj, idx)
trj |
Trajectory to extract points and metadata from. |
idx |
Indices of the points in |
Note that removing points from a trajectory that does not contain a time column will change the timing of the points, and hence change velocity etc.
A new trajectory which is the same as trj
except with a subset
of points.
## Not run:
# Create a trajectory (trj2) by removing all zero-length
# segments from another trajectory (trj). Keep all points
# that are different from their preceding point, and also
# keep the start point
trj2 <- TrajFromTrjPoints(trj, c(1, which(Mod(trj$displacement) != 0)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.