Description Usage Arguments Value Examples

View source: R/CombineIndices.R

Function to combine climate indices for multiple models through addition, subtraction, division or averaging, optionally applying weights to each index.

1 | ```
CombineIndices(indices, weights = NULL, operation = "mean")
``` |

`indices` |
List of n-dimensional arrays with equal dimensions to be combined. |

`weights` |
Vector of weights for the indices, whose length is the same as the list of parameter |

`operation` |
The operation for combining the indices, either |

An array of the same dimensions as one of the elements in the parameter `indices`

.

1 2 3 4 5 6 7 8 9 10 11 12 | ```
a <- matrix(rnorm(6), 2, 3)
b <- matrix(rnorm(6), 2, 3)
comb_ind <- CombineIndices(indices = list(a, b), weights = c(2, 1), operation = "add")
print(comb_ind)
a <- rnorm(24)
dim(a) <- c(lon = 2, lat = 3, mod = 4)
b <- rnorm(24)
dim(b) <- c(lon = 2, lat = 3, mod = 4)
comb_ind <- CombineIndices(indices = list(a, b), weights = c(2, 1), operation = "add")
print(comb_ind)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.