kin.find.traj.landmark: Find Landmark Frame in Trajectory Data

View source: R/kin.find.traj.landmark.R

kin.find.traj.landmarkR Documentation

Find Landmark Frame in Trajectory Data

Description

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.

Usage

kin.find.traj.landmark(condition)

Arguments

condition

A character string containing an R expression that evaluates to a logical vector. The expression should reference variables in the current environment.

Details

The function works by:

  1. Evaluating the provided condition

  2. Finding consecutive sequences where the condition is TRUE

  3. Identifying the longest such sequence

  4. Returning the first frame of that sequence

Value

An integer representing the landmark frame number, or NA if no landmark is found or if an error occurs during execution.

Examples

## 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)


ccamp83/kinesis documentation built on July 4, 2025, 6:19 p.m.