n_events: Number of rain events

Description Usage Arguments Value Examples

View source: R/measure_intensity.R

Description

Number of rain events

Usage

1
n_events(x, min_length = 1)

Arguments

x

numeric vector

min_length

a positive integer. The minimum number of days an event has to be in order to count it.

Value

The number of rain events in x. Rain events are defined as a sequence with 1 (default) or more consecutive days with rain

Examples

1
2
3
n_events(rep(c(0, 1), 5)) == 5
n_events(rep(c(0, 1), each = 5)) == 1
n_events(c(1, 1, 0, 0.5, 0, .1, .2, 0), min_length = 2) == 2

MartinHoldrege/precipr documentation built on Nov. 4, 2021, 11:10 a.m.