Skip to contents

Returns an integer or vector specifying the reporting structure, which indicates how the reporting triangle is organized. This structure tells construct_triangle() how to create new reporting triangles with the same reporting pattern.

Usage

get_reporting_structure(reporting_triangle)

Arguments

reporting_triangle

A reporting_triangle object with rows representing reference times and columns representing delays. Can be a reporting matrix or incomplete reporting matrix. Can also be a ragged reporting triangle, where multiple columns are reported for the same row (e.g., weekly reporting of daily data).

Value

Integer or vector specifying the reporting structure. If integer, divides columns evenly by that integer (with last possibly truncated). If vector, the sum must not be greater than or equal to the number of columns. Default is 1 (standard triangular structure). If there are no NAs, will return 0.

Examples

# Get structure from example triangle
structure <- get_reporting_structure(example_reporting_triangle)
structure
#> [1] 1 0 1 1