calculate_anomaly: Anomaly function wrapper

View source: R/anomaly.R

calculate_anomalyR Documentation

Anomaly function wrapper

Description

Directs data to appropriate anomaly calculation function within multivaR based on temporal and regional scales of data and metric type. All functions are desinged specifically to handle data from the azmpdata package. If a user wanted to modify these functions to use with external data sources, extrame caution should be taken.

Usage

calculate_anomaly(data, anomalyType, climatologyYears, var, normalizedAnomaly)

Arguments

data

A data frame from azmpdata

anomalyType

A character string, options 'annual', 'monthly' or 'seasonal' depending on the type of anomaly the user wishes to calculate

climatologyYears

a Vector of two numeric values determining the start and end years of the period which will be used to calculate a climatology

var

Required only if using monthly or aggregate annual anomaly calculations, character string describing the variable for which anomaly should be calculated

normalizedAnomaly

Required only if using monthly or aggregate annual anomaly calculations, logical indicating whether or not to normalize anomaly calculations

Details

There are multiple anomaly function available within multivaR and each should be used in a different context with different data metrics. The functions wrapped within this function are as follows

  • Annual Anomaly caluclation with Annual climatology

    • This is used in biogeochemical metric anomaly caluclations on a regional scale for annual data

  • Monthly anomaly with monthly climatology

    • This is used for some physical metrics using occupation temporal scale data or monthly data

  • Annual anomaly from monthly climatology

    • This is used for some physical metrics, it first calculates a monthly anomaly and monthly climatology then aggregates the monthly data points by year to calculate annual anomalies

  • Seasonal anomaly with seasonal climatology

    • Used in some biolgoical metrics such as zooplankton biomass and calanus finmarchicus abundance, requires some extra metadata to confirm seasonal distinctions (not yet implemented)


Echisholm21/multivaR documentation built on March 30, 2022, 5:55 a.m.