seas2ann {flood}R Documentation

Annual maxima from seasonal maxima

Description

Calculates annual maxima from seasonal maxima of two seasons.

Usage

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

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)

[Package flood version 0.1.1 Index]