seas2ann: Annual maxima from seasonal maxima

Description Usage Arguments Value Examples

View source: R/seas2ann.R

Description

Calculates annual maxima from seasonal maxima of two seasons.

Usage

1
seas2ann(x1, x2, na.rm = TRUE)

Arguments

x1

vector or matrix of observations from season 1 (rows: observations, columns: stations).

x2

vector or matrix of observations from season 2 (rows: observations, columns: stations).

na.rm

logical. TRUE: the annual maximum will be calculated even if one observation of the two seasons is a missing value, e.g. winter maximum is 58 and summer maximum is NA the annual maximum is 58. If both observations are NA, the annual maximum is set to NA, too. FALSE: the annual maximum will be set to NA if one observation of the two seasons is a missing value, e.g. winter maximum is 58 and summer maximum is NA the annual maximum is NA.

Value

Matrix of annual observations (rows: observations, columns: stations).

Examples

1
2
3
4
5
6
7
8
9
set.seed(28379)
x1 <- matrix(round(rnorm(8, 20, 25)), ncol=2)
x1[2] <- NA
x2 <- matrix(round(rnorm(8, 20, 25)), ncol=2)
x2[c(2,5,6)] <- NA
x1
x2
seas2ann(x1,x2,TRUE)
seas2ann(x1,x2,FALSE)

flood documentation built on May 30, 2017, 8:25 a.m.