context("test-triangles.R")
# Need to add tests
# transactions <- sample_transactions(nCusts = 3, sdTransactions = 3, minDate = as.Date("2017-01-01"), maxDate = as.Date("2017-12-31"))
# transactions <- structure(
# list(
# TransactionID = 1:7,
# TransactionDate = structure(c(17181, 17411, 17348, 17371, 17273, 17434, 17360), class = "Date"),
# CustomerID = c(1L, 1L, 1L, 2L, 3L, 3L, 3L),
# Amount = c(13.39, 10.14, 1.45, 1.58, 3.35, 7.56, 4.28),
# Product = c("G", "A", "U", "J", "J", "Y", "B")
# ),
# .Names = c("TransactionID", "TransactionDate", "CustomerID", "Amount", "Product"),
# class = c("data.table", "data.frame"),
# row.names = c(NA, -7L),
# sorted = "TransactionID"
# )
# make_triangles(transactions, format = "tall", method = "dynamic", rowDev = 3, colDev = 3, initialAge = 3, originLength = 3)
# make_triangles(transactions, format = "tall", method = "dynamic", rowDev = 3, colDev = 3, initialAge = 3, originLength = 3,
# lastValuationDate = as.Date("2017-12-31"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.