This function processes and prepares trajectory data for plotting in an ENA set. It handles rotation, grouping, and filling missing steps in the trajectory.
Usage
prepare_trajectory_data(
x = NULL,
by = x$`_function.params`$conversation[1],
rotation_matrix = x$rotation.matrix,
points = NULL,
units = points,
units_by = x$`_function.params`$units,
steps = NULL
)Arguments
- x
An ENA set object. If `NULL`, other parameters must be provided.
- by
A character vector specifying the grouping variables for the trajectory. Default is the first conversation parameter in the ENA set.
- rotation_matrix
A matrix used to rotate the points. Default is the rotation matrix from the ENA set.
- points
A data table of points to be processed. Default is the points from the ENA set.
- units
A data table of units corresponding to the points. Default is the trajectories or points from the ENA set.
- units_by
A character vector specifying the unit grouping variables. Default is the unit parameters from the ENA set.
- steps
A data table specifying the steps for the trajectory. If `NULL`, steps are generated automatically.
