metrumresearchgroup / bbr

R interface for model and project management
https://metrumresearchgroup.github.io/bbr/
Other
22 stars 2 forks source link

param_estimates_batch: don't rely on fread's header guess #648

Closed kyleam closed 5 months ago

kyleam commented 5 months ago

param_estimates_batch() consumes bbi nonmem params --dir ... output. That has a header such as

dir,error,termination,THETA1,[...],SIGMA(1_1),[...],OMEGA(2_2)

When feeding those lines to fread(), we do not specify that there is a header and instead let fread() guess.

The recent data.table 1.15.0 release includes a change to the guessing strategy: f83123f3 (fread improve containing header guess, 2021-11-30). With that commit, two param_estimates_batch() test cases fail because fread() incorrectly guesses that there isn't a header. The input for those cases look like this:

[1] "dir,error,termination,"
[2] "dirname,msg,,"

Tell fread() that the input has a header to avoid the problem.

Closes #647.