ddalthorp / GenEst

R package development for a generalized mortality estimator
Other
6 stars 6 forks source link

GenEst::desc column names are not ordered correctly anymore #653

Open jlombard314159 opened 3 years ago

jlombard314159 commented 3 years ago

Hi Dan. In a recent GenEst release I saw a note that there was a bug fix for GenEst::desc(). This seems to have actually created a bug. If you enter a vector with length >1 the confidence interval (_lwr and _upr) do not get assigned properly.

See code below:

library(GenEst)
data_CP <- mock$CP

cpModel <- cpm(formula_l = l ~ 1, formula_s = s ~ 1, data = data_CP,
             left = "LastPresentDecimalDays",
             right = "FirstAbsentDecimalDays", dist = "weibull"
           )

GenEst::desc(cpModel,Ir = c(1,100,10000))

image

If needed I can dig into GenEst::desc() more but it seems like we can just revert back.

ddalthorp commented 3 years ago

Thanks, John. This looks like an older version. I think 1.4.5.1 (at CRAN and github.com) works.

jlombard314159 commented 3 years ago

It did. Thank you!

jlombard314159 commented 3 years ago

Hi Dan.

I updated to GenEst 1.4.5.1. The code below errors if I provide only one search interval value for Ir. Ir = c(1,100,1000) or anything with >1 length works though.

library(GenEst)
data_CP <- mock$CP

cpModel <- cpm(formula_l = l ~ 1, formula_s = s ~ 1, data = data_CP,
             left = "LastPresentDecimalDays",
             right = "FirstAbsentDecimalDays", dist = "weibull"
           )

GenEst::desc(cpModel,Ir = c(1))

image