View source: R/kin.find.traj.landmark.R
kin.find.traj.landmark | R Documentation |
Identifies a landmark frame in trajectory data based on a specified condition. Returns the first frame of the longest consecutive sequence where the condition is met.
kin.find.traj.landmark(condition)
condition |
A character string containing an R expression that evaluates to a logical vector. The expression should reference variables in the current environment. |
The function works by:
Evaluating the provided condition
Finding consecutive sequences where the condition is TRUE
Identifying the longest such sequence
Returning the first frame of that sequence
An integer representing the landmark frame number, or NA if no landmark is found or if an error occurs during execution.
## Not run:
# Example with velocity data
velocity <- c(0.1, 0.2, 0.5, 0.7, 0.8, 0.9, 0.7, 0.4, 0.2)
landmark <- kin.find.traj.landmark("velocity > 0.5")
# Example with position data
position <- c(1, 2, 5, 8, 10, 12, 13, 14, 15)
landmark <- kin.find.traj.landmark("position > 10")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.