R Under development (unstable) (2024-02-23 r85978 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > require(lifecontingencies) Loading required package: lifecontingencies Package: lifecontingencies Authors: Giorgio Alfredo Spedicato [aut, cre] (), Christophe Dutang [ctb] (), Reinhold Kainhofer [ctb] (), Kevin J Owens [ctb], Ernesto Schirmacher [ctb], Gian Paolo Clemente [ctb] (), Ivan Williams [ctb] Version: 1.3.12 Date: BugReport: https://github.com/spedygiorgio/lifecontingencies/issues > > > #test abbreviated arguments > > c(annuity(i=0.05, n=5, type = "due"), annuity(i=0.05, n=5, type = "adv")) [1] 4.545951 4.545951 > > c(annuity(i=0.05, n=5, type = "arr"), annuity(i=0.05, n=5, type = "im")) [1] 4.329477 4.329477 > > c(accumulatedValue(i=0.05, n=5, type = "arr"), accumulatedValue(i=0.05, n=5, type = "im")) [1] 5.525631 5.525631 > > c(decreasingAnnuity(i=0.05, n=5, type = "arr"), decreasingAnnuity(i=0.05, n=5, type = "im")) [1] 13.41047 13.41047 > > c(decreasingAnnuity(i=0.05, n=5, type = "due"), decreasingAnnuity(i=0.05, n=5, type = "adv")) [1] 14.08099 14.08099 > > c(increasingAnnuity(i=0.05, n=5, type = "arr"), increasingAnnuity(i=0.05, n=5, type = "im")) [1] 12.56639 12.56639 > > #test defensive programming > try( + annuity(i=0.05, n=5, type = "foo1") + ) Error in match.arg(x, c("advance", "due", "immediate", "arrears")) : 'arg' should be one of "advance", "due", "immediate", "arrears" > > > proc.time() user system elapsed 1.68 0.17 1.84