Skip to contents

Smooths columns specified in cols for each individual point over time, using a smoothing spline. Optionally fills in gaps of less than fillgaps frames.

Usage

smooth_points_df(
  .data,
  cols,
  spar,
  .out = NULL,
  .frame = frame,
  .point = point,
  fillgaps = 0
)

Arguments

.data

Data frame containing the midlines.

cols

Columns containing the components to be smoothed. Often these will be the x and y coordinates of the midline.

.out

Names of the output columns. Should either be a list with the same number of elements as cols, or a glue specification as in dplyr::across for the .names parameter. The default (NULL) means that the output columns will have the same name as the original column with an 's' appended at the end.

.frame, .point

Columns identifying frames and points (defaults are frame and point)

fillgaps

Longest gap to interpolate over. default is 0, which means not to fill gaps

Value

A data frame containing the smoothed points