##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (MCL)
{
n <- ncol(MCL[["MCLPaid"]])
.Paid <- as.matrix(MCL[["Paid"]])
.Incurred <- as.matrix(MCL[["Incurred"]])
LatestPaid = rev(.Paid[row(.Paid) == (n + 1 - col(.Paid))])
LatestIncurred = rev(.Incurred[row(.Incurred) == (n + 1 -
col(.Incurred))])
UltimatePaid = MCL[["MCLPaid"]][, n]
UltimateIncurred = MCL[["MCLIncurred"]][, n]
Result <- data.frame(LatestPaid, LatestIncurred, Latest.P.I.Ratio = LatestPaid/LatestIncurred,
UltimatePaid, UltimateIncurred, Ultimate.P.I.Ratio = UltimatePaid/UltimateIncurred)
return(Result)
}
Run the code above in your browser using DataLab