Breaking changes
-
The interface is now split into three tiers (#30). The individual functions work on a vector or a frame of coordinate columns,
*_with()selects a method by name, and*_across()applies one to a whole aniframe.filter_across(data, "lowpass", cutoff_freq = 5) filter_with(x, "gaussian", sigma = 2) data |> mutate(filter_ccma(pick(all_of(c("x", "y")))))
-
filter_aniframe()is removed — usefilter_across(). -
replace_na()is removed — usereplace_na_with(), which does not collide withtidyr::replace_na(). -
filter_ccma(),filter_na_speed(),filter_na_excursion(),filter_na_roi()andfilter_na_confidence()now take a frame of coordinate columns rather than an aniframe. Usefilter_across()/filter_na_across()for a whole aniframe. -
Filters preserve gaps by default:
keep_naisTRUEeverywhere except the Kalman filters, where inferring across gaps is the point. Passkeep_na = FALSEfor the old behaviour (#38). -
Argument names are consistent across the package:
window_widthreplaceswindow_sizeinfilter_sgolay(),find_peaks()andfind_troughs();xreplacesmeasurementsin the Kalman filters;min_value/max_valuereplacemin/maxinfilter_na_range(). -
filter_na_confidence()no longer masks rows whose confidence isNA, and warns instead — a missing score means not assessed, not poor. -
filter_na_across(method = "speed")estimates an"auto"threshold per group. Passthreshold = "pooled"for a single estimate across all groups, which is steadier when tracks are short.
New features
- New
filter_one_euro(): the One Euro filter (Casiez, Roussel & Vogel, 2012), an adaptive low-pass whose cutoff rises with the speed of the signal — smooth when the animal is still, responsive when it moves (#35). *_across()uses what the aniframe already knows:sampling_rateand the time column come from its metadata.variablesselects columns with tidyselect, defaulting tovariables_where.keep_nais available on every filter, and validated.
Bug fixes
filter_na_speed()computes speed within each group, so a step is never formed between one track and the next. Wheretimerestarts per track that step inflated the"auto"threshold and caused genuine outliers to be missed (#37).- Differencing filters (
on_deltas, formerlyuse_derivatives) re-integrate from the original starting value; they previously dropped the first sample and shifted the whole series (#30). filter_na_speed()no longer blanks groups too short to contain a step (#37).- The
data.table (>= 1.18.0)requirement is enforced when the package loads, not only when it is installed (#33).
Performance
filter_ccma()andfilter_na_excursion()no longer scale quadratically in the number of groups. At 3,000 groups they are roughly 8× and 3.5× faster (#37).