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 > > data(soa08Act) > > #test abbreviated arguments > pxt(object=soa08Act, x=90, t=3/2, frac="const") [1] 0.7233437 > pxt(object=soa08Act, x=90, t=3/2, frac="exp") [1] 0.7233437 > > pxt(object=soa08Act, x=90, t=3/2, frac="lin") [1] 0.728104 > pxt(object=soa08Act, x=90, t=3/2, frac="unif") [1] 0.728104 > > pxt(object=soa08Act, x=90, t=3/2, frac="hyp") [1] 0.7186145 > pxt(object=soa08Act, x=90, t=3/2, frac="Bal") [1] 0.7186145 > pxt(object=soa08Act, x=90, t=3/2, frac="harm") [1] 0.7186145 > > qxt(object=soa08Act, x=90, t=3/2, frac="const") [1] 0.2766563 > qxt(object=soa08Act, x=90, t=3/2, frac="exp") [1] 0.2766563 > > qxt(object=soa08Act, x=90, t=3/2, frac="lin") [1] 0.271896 > qxt(object=soa08Act, x=90, t=3/2, frac="unif") [1] 0.271896 > > qxt(object=soa08Act, x=90, t=3/2, frac="hyp") [1] 0.2813855 > qxt(object=soa08Act, x=90, t=3/2, frac="Bal") [1] 0.2813855 > qxt(object=soa08Act, x=90, t=3/2, frac="harm") [1] 0.2813855 > > exn(object=soa08Act, x=90, type="cur") [1] 3.203979 > exn(object=soa08Act, x=90, type="Kx") [1] 3.203979 > > exn(object=soa08Act, x=90, type="con") [1] 3.703979 > exn(object=soa08Act, x=90, type="Tx") [1] 3.703979 > > > pxyzt(list(soa08Act, soa08Act), x=c(55, 50), t=10.33, frac="lin") [1] 0.7883854 > pxyzt(list(soa08Act, soa08Act, soa08Act), x=c(55, 50, 45), t=10.33, frac=c("unif", "Bal", "exp")) [1] 0.741139 > pxyzt(list(soa08Act, soa08Act), x=c(55, 50), t=10.33, status="jo") [1] 0.7883854 > pxyzt(list(soa08Act, soa08Act), x=c(55, 50), t=10.33, status="Last-Survi") [1] 0.9880024 > pxyzt(list(soa08Act, soa08Act), x=c(55, 50), t=10.33, status="la") [1] 0.9880024 > > > exyzt(list(soa08Act, soa08Act), x=c(55, 50), t=10.33, status="la", type="K") [1] 9.964271 > exyzt(list(soa08Act, soa08Act), x=c(55, 50), t=10.33, status="jo", type="T") [1] 9.492079 > > #test defensive programming > try( + pxt(object=soa08Act, x=90, t=2, frac="foo1") + ) Error in match.arg(x, c("linear", "uniform", "hyperbolic", "constant force", : 'arg' should be one of "linear", "uniform", "hyperbolic", "constant force", "exponential", "harmonic", "Balducci" > try( + pxt(object=soa08Act, x=90, t=2, frac=TRUE) + ) Error in match.arg(x, c("linear", "uniform", "hyperbolic", "constant force", : 'arg' must be NULL or a character vector > > try( + qxt(object=soa08Act, x=90, t=2, frac="foo1") + ) Error in match.arg(x, c("linear", "uniform", "hyperbolic", "constant force", : 'arg' should be one of "linear", "uniform", "hyperbolic", "constant force", "exponential", "harmonic", "Balducci" > try( + qxt(object=soa08Act, x=90, t=2, frac=TRUE) + ) Error in match.arg(x, c("linear", "uniform", "hyperbolic", "constant force", : 'arg' must be NULL or a character vector > try( + exn(object=soa08Act, x=90, type="foo3") + ) Error in match.arg(x, c("Tx", "Kx", "continuous", "curtate", "complete")) : 'arg' should be one of "Tx", "Kx", "continuous", "curtate", "complete" > > try( + pxyzt(list(soa08Act, soa08Act, soa08Act), x=c(55, 50, 45), t=10.33, frac=c("foo1", "Bal", "exp")) + ) Error in match.arg(x, c("linear", "uniform", "hyperbolic", "constant force", : 'arg' should be one of "linear", "uniform", "hyperbolic", "constant force", "exponential", "harmonic", "Balducci" > try( + pxyzt(list(soa08Act, soa08Act, soa08Act), x=c(55, 50, 45), t=10.33, frac=c("unif", FALSE, "exp")) + ) Error in match.arg(x, c("linear", "uniform", "hyperbolic", "constant force", : 'arg' should be one of "linear", "uniform", "hyperbolic", "constant force", "exponential", "harmonic", "Balducci" > try( + pxyzt(list(soa08Act, soa08Act), x=c(55, 50), t=10.33, status="foo2") + ) Error in match.arg(x, c("last", "joint", "Joint-Life", "Last-Survivor")) : 'arg' should be one of "last", "joint", "Joint-Life", "Last-Survivor" > try( + pxyzt(list(soa08Act, soa08Act), x=c(55, 50), t=10.33, status=log(3)) + ) Error in match.arg(x, c("last", "joint", "Joint-Life", "Last-Survivor")) : 'arg' must be NULL or a character vector > try( + exyzt(list(soa08Act, soa08Act), x=c(55, 50), t=10.33, status="lol", type="K") + ) Error in match.arg(x, c("last", "joint", "Joint-Life", "Last-Survivor")) : 'arg' should be one of "last", "joint", "Joint-Life", "Last-Survivor" > try( + exyzt(list(soa08Act, soa08Act), x=c(55, 50), t=10.33, status="jo", type=12345) + ) Error in match.arg(x, c("Tx", "Kx", "continuous", "curtate", "complete")) : 'arg' must be NULL or a character vector > > proc.time() user system elapsed 1.82 0.20 2.01