View source: R/new_functions.R
get_departures | R Documentation |
Calculates univariate or multivariate climate departures from baseline conditions
get_departures( vars, baseline.years, comparison.years, dist.method = c("mahalanobis", "sed"), yearbounds = NULL )
vars |
a list of matrices with equal dimensions containing climate or weather data; nrow is the number of cells or points and ncol is the number of years |
baseline.years |
an integer vector of which years should be used for the historical period |
comparison.years |
an integer vector of which years should be the future period relative to baseline |
dist.method |
a character vector indicating if Mahalanobis ("mahalanobis") or Standardized Euclidean ("sed") distance should be used |
yearbounds |
a numeric vector of length 2 indicating the first and last year in the data |
This function makes all sorts of assumptions about your data, like that each column represents an individual year and that those years are sequential with the earliest year in the first column and no gaps between years.
If multiple variables are passed to the function (i.e. the list of vars has length > 2), it calculates a multivariate departure; if only one variable is passed to the function it returns a univariate departure.
a matrix of climate departures where each row is a cell or point and each column is a year in the comparison period
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.