Skip to contents

Apply one of five smoothing methods to each taxon in the community data before RoC is computed.

Usage

smooth_community_data(
  data_source_smooth,
  smooth_method = c("m.avg", "grim", "age.w", "shep"),
  smooth_n_points = 5,
  smooth_n_max = 9,
  smooth_age_range = 500,
  round_results = FALSE,
  verbose = FALSE,
  silent = FALSE
)

Arguments

data_source_smooth

List with community, and age

smooth_method

character. Smoothing method applied to each taxon before RoC is computed.

  • "none" - no smoothing (default)

  • "shep" - Shepard's 5-term filter (Davis, 1986; Wilkinson, 2005)

  • "m.avg" - moving average

  • "age.w" - age-weighted average

  • "grim" - Grimm's smoothing (Grimm & Jacobson, 1992). The window of each sample starts with the smooth_n_points samples centred on it, except that the windows of the first (smooth_n_max - 1) / 2 samples start at the first sample (with the defaults, the window of sample 4 starts with samples 1 to 6). It widens by one sample on each side at a time, in at most smooth_n_max - smooth_n_points steps, while it spans less than smooth_age_range years and has at most smooth_n_max samples. Windows near the ends of the sequence can therefore stay smaller than smooth_n_max. The window is not always centred on its sample, and neighbouring samples can end up with the same window. Their smoothed values are then identical, and the RoC between them is zero.

smooth_n_points

numeric. Number of samples in the window of moving average and age-weighted smoothing, and in the starting window of Grimm smoothing: the sample and (smooth_n_points - 1) / 2 samples on each side (for Grimm, see the exception at the start of the sequence under smooth_method). Near the ends of the sequence, the window is cut at the first or last sample and holds fewer samples. Must be a positive, odd whole number. Shepard's filter always uses the sample and two samples on each side; for it, smooth_n_points (a whole number greater than 2) only sets how many samples at each end of the sequence are left unsmoothed: smooth_n_points / 2, rounded to the nearest whole number with halves rounded to the even number (2 for 3 to 5, 4 for 7 to 9).

smooth_n_max

numeric. Maximum number of samples included in a Grimm smoothing window. Must be an odd whole number larger than smooth_n_points.

smooth_age_range

numeric. Maximum age range (in years) for Grimm and age-weighted smoothing windows.

round_results

Logical. Should smoothed values be rounded to integers?

verbose

logical. If TRUE, print progress messages during computation.

silent

logical. If TRUE, suppress all console output (overrides verbose).

Value

The input list with the community element replaced by the smoothed values.

References

Davis, J.C., 1986. Statistics and Data Analysis in Geology, 2nd edn. J. Wiley & Sons, New York.

Grimm, E.C., Jacobson, G.L., 1992. Fossil-pollen evidence for abrupt climate changes during the past 18000 years in eastern North America. Clim. Dyn. 6, 179-184.

Wilkinson, L., 2005. The Grammar of Graphics. Springer-Verlag, New York.

See also