Learn R Programming

baselinenowcast (version 0.2.0)

.update_triangle_matrix: Update reporting_triangle with new matrix data

Description

Internal helper to create a new reporting_triangle from modified matrix data while preserving the original object's metadata (reference dates, delays_unit). This simplifies the pattern of converting to matrix, operating on it, then restoring the reporting_triangle class and attributes.

Usage

.update_triangle_matrix(reporting_triangle, new_matrix, reference_dates = NULL)

Value

A new reporting_triangle object with the updated matrix data.

Arguments

reporting_triangle

The original reporting_triangle object.

new_matrix

The modified matrix data.

reference_dates

Optional. Reference dates for the new matrix. If NULL, extracts from the original reporting_triangle object.