jthaman / ciTools

An R Package for Quick Uncertainty Intervals
GNU General Public License v3.0
106 stars 9 forks source link

Only predict into levels that are fit in the model, and issue a warning when they are not available. Also, enable ... to pass arguments to `boot::boot()` #53

Open billdenney opened 3 years ago

billdenney commented 3 years ago

This fixes #52 by setting factor levels to NA when they are not part of the data that are fit in the update. (It should be compatible with PR #51 as it changes code below the model fitting while that PR changes code up to and including the model fitting.)

billdenney commented 3 years ago

FYI, one downside to this PR is that there will usually be tons of warnings. Some way to manage the warnings so that they only occur once per column per bootstrap would likely be helpful. The fix that occurred to me is a bit more invasive, and it wasn't clear that the benefit was worth the code maintenance (maybe there is a simpler way than the one that occurred to me, though).

jthaman commented 3 years ago

Just a note that I have not forgotten about this PR and will review.