Learn R Programming

baselinenowcast (version 0.2.0)

truncate_to_row: Truncate reporting triangle by removing a specified number of the last rows

Description

Removes the last t rows from a reporting triangle to simulate what would have been observed at an earlier reference time.

Usage

truncate_to_row(reporting_triangle, t, validate = TRUE)

Value

trunc_rep_tri A reporting_triangle object with t fewer rows than the input. The class and metadata are preserved with updated reference dates.

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

t

Integer indicating the number of timepoints to truncate off the bottom of the original reporting triangle.

validate

Logical. If TRUE (default), validates the object. Set to FALSE only when called from functions that already validated.

See Also

Retrospective data generation functions apply_reporting_structure(), apply_reporting_structures(), truncate_to_rows()

Examples

Run this code
# Generate single truncated triangle
trunc_rep_tri <- truncate_to_row(example_reporting_triangle, t = 1)
trunc_rep_tri

Run the code above in your browser using DataLab