Skip to contents

Creates a new reporting_triangle with columns filtered to include only delays from 0 to the specified maximum delay. This is useful when you want to limit the delay distribution used for estimation.

Usage

truncate_to_delay(x, max_delay)

Arguments

x

A reporting_triangle object.

max_delay

Integer specifying the maximum delay to retain. Must be between 0 and the current maximum delay of the triangle.

Value

A new reporting_triangle object with delays 0 through max_delay.

Examples

# Truncate to delays 0-2
rt_short <- truncate_to_delay(example_downward_corr_rt, max_delay = 2)
#>  Truncating from max_delay = 3 to 2.
get_max_delay(rt_short)  # Returns 2
#> [1] 2