Learn R Programming

baselinenowcast (version 0.2.0)

as.data.frame.reporting_triangle: Convert reporting_triangle to data.frame

Description

Convert reporting_triangle to data.frame

Usage

# S3 method for reporting_triangle
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

Value

A data.frame with columns reference_date, report_date, delay, count

Arguments

x

A reporting_triangle object to convert.

row.names

NULL or character vector giving row names for the data frame. Missing values are not allowed.

optional

Logical. If TRUE, setting row names and converting column names is optional.

...

Additional arguments to be passed to or from methods.

See Also

Reporting triangle construction and validation [.reporting_triangle(), [<-.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(), get_reporting_structure(), 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
# Convert reporting triangle to data frame
df <- as.data.frame(example_reporting_triangle)
head(df)

Run the code above in your browser using DataLab