Get positions relative to group
get_position_relative_to_group.Rd
Get individual position relative to the group centroid and heading for all individuals.
Usage
get_position_relative_to_group(
xs,
ys,
heading_type,
spatial_R = NULL,
t_window = NULL,
forward = T,
min_inds_tracked = NULL
)
Arguments
- xs
N x n_times
matrix giving x coordinates of each individual over time- ys
N x n_times
matrix giving y coordinates of each individual over time- heading_type
character string specifying heading type -
'spatial'
or'temporal'
- spatial_R
radius to use for spatial headings (if
heading_type = 'spatial'
)- t_window
temporal window to use for temporal headings (if
heading_type = 'temporal'
)- forward
whether to compute headings into the future (
forward = T
) or the past (forward = F
)- min_inds_tracked
if specified, sets a minimum number of individuals that must be tracked at any moment in time to compute heading (otherwise all positions will be NA at that time point)
Value
Returns a list containing rel_xs and rel_ys matrices of each individual's position relative to the group centroid and heading