Learn R Programming

baselinenowcast (version 0.2.0)

get_reporting_structure: Get reporting structure from a reporting triangle

Description

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

Usage

get_reporting_structure(reporting_triangle)

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.

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).

See Also

Reporting triangle construction and validation [.reporting_triangle(), [<-.reporting_triangle(), as.data.frame.reporting_triangle(), as.matrix.reporting_triangle(), as_ChainLadder_triangle(), as_reporting_triangle(), as_reporting_triangle.data.frame(), as_reporting_triangle.matrix(), as_reporting_triangle.triangle(), assert_reporting_triangle(), get_delays_from_dates(), get_delays_unit(), get_max_delay(), get_mean_delay(), get_quantile_delay(), get_reference_dates(), get_report_dates(), head.reporting_triangle(), is_reporting_triangle(), new_reporting_triangle(), print.reporting_triangle(), reporting_triangle-class, summary.reporting_triangle(), tail.reporting_triangle(), truncate_to_delay(), truncate_to_quantile(), validate_reporting_triangle()

Examples

Run this code
# Get structure from example triangle
structure <- get_reporting_structure(example_reporting_triangle)
structure

Run the code above in your browser using DataLab