Add formatted worksheet to a workbook
add_sicr_worksheet.Rd
This function adds a properly formatted worksheet with payments and reserves information to an existing workbook.
Arguments
- workbook
Workbook created via
openxlsx2::wb_workbook()
.- sheetname
Desired sheet name.
- payments
Numeric matrix of historic and future payments with origin years as rownames and origin years + 250 as calendar years as colnames.
- reserved
Default: NULL. Numeric matrix with historic payments. Not considered if NULL.
Examples
future_payments <- matrix(0, 35, 250)
colnames(future_payments) <- 2024:2273
future_payments[,1] <- 1e6 # some entries to show functionality
payments <- cbind(all_claims_paid_xmpl, future_payments)
workbook <- openxlsx2::wb_workbook()
workbook <- add_sicr_worksheet(workbook = workbook,
sheetname = "new_sheet",
payments = payments,
reserved = all_claims_reserved_xmpl)
# either open with openxlsx2::wb_open(workbook) or save via openxlsx2::wb_save(workbook)