Anomaly function

Anomalies

Anomalies

Saves keystrokes for computing anomalies.

Anomaly(x, baseline = seq_along(x), ...)

Arguments

  • x: numeric vector
  • baseline: logical or numerical vector used for subsetting x before computing the mean
  • ...: other arguments passed to mean such as na.rm

Returns

A numeric vector of the same length as x with each value's distance to the mean.

Examples

# Zonal temperature anomaly library(data.table) temperature[, .(lon = lon, air.z = Anomaly(air)), by = .(lat, lev)]

See Also

Other utilities: JumpBy(), Mag(), Percentile(), logic

  • Maintainer: Elio Campitelli
  • License: GPL-3
  • Last published: 2025-02-24