Description Usage Arguments Details Examples
Convert a single triangle from tall format to triangular format
1 2 | as.triangle(triangleDT, valueCol = "Transactions",
descriptiveHeaders = TRUE, idCols = "Cohort")
|
triangleDT |
A triangle in tall, data.table format |
valueCol |
Name of the column to convert to triangular format |
descriptiveHeaders |
Should headers be descriptive? |
Returns a matrix object with rows representing origin periods and columns representing valuation ages
1 2 3 4 5 6 7 | library(data.table)
set.seed(2357)
transactions <- sample_transactions(10)
triangles <- make_triangles(transactions, format="tall")
as.triangle(triangles, valueCol="ActiveCustomers")
as.triangle(triangles, valueCol="Transactions")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.