R Under development (unstable) (2024-09-28 r87201 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 > data(soa08Act) > set.seed(123) > rLife(2, soa08Act, x=0,k=1, type="T") [1] 76.5 60.5 > set.seed(123) > rLife(2, soa08Act, x=0,k=1, type="cont") [1] 76.5 60.5 > > set.seed(123) > rLife(2, soa08Act, x=0,k=1, type="Kx") [1] 76 60 > set.seed(123) > rLife(2, soa08Act, x=0,k=1, type="cur") [1] 76 60 > > rLifexyz(3, list(soa08Act, soa08Act), x=33:34, k=1, type="cont") [,1] [,2] [1,] 41.5 46.5 [2,] 23.5 37.5 [3,] 64.5 21.5 > > set.seed(123) > rLifeContingenciesXyz(n=5, lifecontingency = "Axyz", tablesList = list(soa08Act, soa08Act), + x=59:60, t=30, m=0, k=1, status="j") [1] 0.3305130 0.5918985 0.8396193 0.7472582 0.4172651 > set.seed(123) > rLifeContingenciesXyz(n=5, lifecontingency = "Axyz", tablesList = list(soa08Act, soa08Act), + x=59:60, t=30, m=0, k=1, status="joint") [1] 0.3305130 0.5918985 0.8396193 0.7472582 0.4172651 > > getLifecontingencyPvXyz(deathsTimeXyz=matrix(c(50,50,51,43,44,22,12,56,20,24,53,12),ncol=2), + lifecontingency = "axyz", tablesList = list(soa08Act, soa08Act), i = 0.03, t=30,x=c(40,50), + m=0, k=1,status="la") [1] 9.530203 9.530203 10.252624 3.828611 4.717098 0.000000 0.000000 [8] 13.561102 0.000000 0.000000 11.634955 0.000000 > > > #test defensive programming > try( + rLifexyz(3, list(soa08Act, soa08Act), x=33:34, k=1, type="toto") + ) Error in match.arg(x, c("Tx", "Kx", "continuous", "curtate", "complete")) : 'arg' should be one of "Tx", "Kx", "continuous", "curtate", "complete" > > > proc.time() user system elapsed 1.42 0.17 1.57