extrapolate_moment: Extrapolates object positions based on current state and time

View source: R/trajectory.R

extrapolate_momentR Documentation

Extrapolates object positions based on current state and time

Description

Intended for the use in custom step functions.

Usage

extrapolate_moment(moment, timestep, cur_time, new_time = NULL)

Arguments

moment

Position tibble with extra columns 'direction' and 'speed'

timestep

How far into future should the objects move (linearly)

cur_time

Current time, for time-sensitive speed functions (e.g., accelerations)

new_time

New time value for the returned object. If omitted, it is calculated automatically as 'cur_time + timestep'

Value

Another moment - position tibble with extra columns 'direction' and 'speed' corresponding to time_next

Examples

moment <- position8c %>% add_random_direction() %>%
  dplyr::mutate(speed = 3)
extrapolate_moment(moment, 0.1, 0)

jirilukavsky/motrack documentation built on Jan. 30, 2023, 5:04 a.m.