AnoAgree {ClimProjDiags}R Documentation

Percentage of anomalies which agrees with the sign of the mean anomaly for multidimensional arrays

Description

This function computes the mean and the percentage of agreement between anomalies.

Usage

AnoAgree(ano, membersdim, na.rm = TRUE, ncores = NULL)

Arguments

ano

A multidimensional array.

membersdim

The dimension in which models are stored.

na.rm

A logical indicating whether missing values should be removed. If na.rm is FALSE an NA value in any of the arguments will cause a value of NA to be returned, otherwise (TRUE by default) NA values are ignored.

ncores

The number of cores to be used when computing the agreement.

Value

An array of one dimension less than the ano object, except for one dimensional arrays or vectors, for which an array of dimension 1 called 'var' is returned.

Examples

# Example with random sample:
a <- NULL
for(i in 1:20) { a <- c(a, rnorm(6)) }
dim(a) <- c(lat = 2, lon = 3, var = 4, mod = 5)

agree <- AnoAgree(ano = a, membersdim = which(names(dim(a)) == 'mod'), 
                 na.rm = TRUE, ncores = NULL)
print(agree)

a <- rnorm(6)
agree <- AnoAgree(ano = a, membersdim = 1, na.rm = TRUE, ncores = NULL)
print(agree)

[Package ClimProjDiags version 0.3.3 Index]