regular_points: Generate regular points along a path

Description Usage Arguments Details Value

View source: R/s5_interpolate_animate.R

Description

Takes a *_paths object and generates regularly-spaced points along the path.

Usage

1
regular_points(paths, Delta_t)

Arguments

paths

An object of class *_paths: either str_paths or lc_paths

Delta_t

The timestep to use for interpolation. The number of interpolated points will be approximately (total time)/Delta_t. See details below.

Details

This function returns points that are regularly placed in space, even though the user provides a time argument (Delta_t). When the input locations are regularly spaced in time, the output locations will be regularly spaced in both space and time. This will already be the case if the user has decided to use COAs to represent the locations.

The number of points returned is reported in the output data.frame in the column $n_interp. We determine this number by counting the length of the sequence from the start time to the end time of the track for each individual, with the by argument being Delta_t. I.e.:

1
2
3
4
5
  n_interp = length(
               seq(
                 from = min(dt),
                 to = max(dt),
                 by = Delta_t))

Therefore, Delta_t can be any value that can be accepted by the by argument of seq.POSIXt().

Value

Returns an object with S3 Class reg_points. Object is also of class sf, tbl_df, tbl, and data.frame.


bsmity13/ADePTR documentation built on Nov. 9, 2019, 12:43 a.m.