Skip to contents

Get maximum delay from reporting_triangle

Usage

get_max_delay(x, non_zero = FALSE)

Arguments

x

A reporting_triangle object

non_zero

Logical. If TRUE, returns the maximum delay where at least one observation is non-zero. Useful for identifying the actual extent of the delay distribution. Default FALSE.

Value

Maximum delay (integer), or -1 if all zero when non_zero = TRUE

Examples

# Get maximum delay from triangle structure
max_delay <- get_max_delay(example_reporting_triangle)
max_delay
#> [1] 3

# Get maximum delay with non-zero observations
max_delay_nz <- get_max_delay(example_reporting_triangle, non_zero = TRUE)
max_delay_nz
#> [1] 3