Fill missing values across an aniframe's spatial columns
Source:R/replace_na_across.R
replace_na_across.RdThe aniframe-level entry point to the replace_na_*() family. Fills
gaps in the columns given by the variables_where metadata field,
within the frame's existing grouping — so a gap is never filled by
interpolating between two different tracks.
Usage
replace_na_across(
data,
method = c("linear", "spline", "stine", "locf", "value"),
variables = NULL,
...
)Arguments
- data
An aniframe.
- method
Character string specifying the replacement method:
"linear": Linear interpolation (default)"spline": Spline interpolation for smoother curves"stine": Stineman interpolation preserving data shape"locf": Last observation carried forward"value": Replace with a constant value
- variables
Columns to fill, as a tidyselect expression. Defaults to the
variables_wheremetadata field.- ...
Arguments passed to
replace_na_with(), such asvalue,min_gapandmax_gap.
See also
replace_na_with() for the vector-level generic.
Examples
if (FALSE) { # \dontrun{
replace_na_across(tracking_data, "linear", max_gap = 5)
replace_na_across(tracking_data, "value", value = 0, variables = c(x, y))
} # }