Description Usage Arguments Value See Also Examples
Function aggregating losses by a given period.
1 | period.loss(data, period = c("none", "days", "weeks", "months", "quarters"),dts = FALSE)
|
data |
list with two columnes, first with dates of events and second with loss amount |
period |
could be |
dts |
logical: whether to have period begins' dates or not ( |
List of aggreagated losses.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | data(loss.data.object)
x<- read.loss(1,2,loss.data.object)
t0 <- period.loss(x,"none"); t0
t1 <- period.loss(x,"days"); t1
t2 <- period.loss(x,"weeks"); t2
t3 <- period.loss(x,"months"); t3
t4 <- period.loss(x,"quarters"); t4
sum(t0);sum(t1); sum(t2); sum(t3); sum(t4) # note that all these values must be equal
# the same with dates - note that only for days and no period there are original
# dates; for weeks, months and periods there are only dates opening period in which
# loss occured
t0 <- period.loss(x,"none",dts=T); t0
t1 <- period.loss(x,"days",dts=T); t1
t2 <- period.loss(x,"weeks",dts=T); t2
t3 <- period.loss(x,"months",dts=T); t3
t4 <- period.loss(x,"quarters",dts=T); t4
sum(t0);sum(t1); sum(t2); sum(t3); sum(t4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.