Closed IvanWilli closed 3 years ago
agree
On Thu, Aug 19, 2021 at 4:23 PM Iván Williams @.***> wrote:
@.**** commented on this pull request.
In R/lt_id.R https://github.com/timriffe/DemoTools/pull/250#discussion_r692159325:
@@ -291,7 +291,7 @@ lt_id_Ll_S <- function(nLx, lx = NULL, Age, AgeInt = NULL, N = 5) { radix <- ifelse(nLx[1]>1, 10^nchar(trunc(nLx[1])), 1) }
validate nLx
- stopifnot(all(nLx>0, nLx[-n] < (radix*N)))
- stopifnot(all(nLx>=0, nLx[-n] < (radix*N)))
Something like nLx>=0 & nLx[Age<100]>0 ? Checking first same length on nLx and Age (probably already checked in parent function)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/timriffe/DemoTools/pull/250#discussion_r692159325, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG43GYLDLRXELACPYXHCBLT5UHURANCNFSM5COJWMBA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
I noted that when extrapolating to 130 for closing-out sometimes last nLx could be zero for low mortality years. I suggest to relax that condition to be non-negatives when creating Sx function.