monolix2rx 0.0.7
Dropped the re-exports (
rxode2(),rxode(),RxODE(),ini(),model(),model<-,rxRename(),rxSolve(),rxUiGet(),logit(),expit(),lotri(),autoplot()and%>%). Loadnlmixr2(orrxode2/magrittr) to get them; this also works around a roxygen2 8.1.0 re-export failure (issue #47, r-lib/roxygen2#1915).monolix2rx(),mlxtran()andmlxTxt()now havedirnto giving the actual directory of the Monolix project, in case the project moved for some reason. This makes it possible to translate project files outside the project directory (#44)The project directory in mlxtran is now absolute.
Import
Monolix2024 Excel (.xls,.xlsx; first sheet) and SAS (.sas7bdat,.xpt) data sets, usingreadxl/havenwhen they are installed (issue #10).The data set regressor columns (
use=regressorin[CONTENT]) are now matched to the model regressors (use=regressorin[LONGITUDINAL]) by their column order in the data set, as Monolix does, and renamed to the model names on import. A mismatched regressor count or a missing regressor column is now an error (issue #2).Imported
amt/time/dvcharacter columns now matchna.stringsliterally (ignoring surrounding whitespace); the default"."was a regular expression wildcard, so any single-character value was silently turned intoNA. GenuineNA, blank and"NaN"values no longer keep such a column as character (issue #56).Imported data sets now cast the continuous covariates to double; previously the categorical covariates were cast instead, turning character categories into
NA.Support the
Monolix2024 file specificationfile={path='data.csv'}in addition to the olderfile='data.csv'; the two are equivalent. This applies to the data file in<DATAFILE> [FILEINFO](and<DATA_FORMATTING> [FILEINFO]) as well as the model file in<MODEL> [LONGITUDINAL](issue #43).Categorical covariate transformations (
[COVARIATE] DEFINITION:transform=/categories=/reference=) without areferencenow fall back to the first category instead of assigning an empty label; the transformation translation is now tested end-to-end (issue #6).Range-check the input length in all 13
trans_*parser entry-points before narrowing it fordparse()’sintbuffer length. A buffer ofINT_MAXbytes or more now raises a clean R error instead of handing the parser a truncated (possibly negative) length. This is defensive: every current caller passes an R string, which R already caps atINT_MAXbytes.Removed the dparser ambiguities in the
EQUATION:/PK:,[LONGITUDINAL] DEFINITION:andfile=grammars, and made the equation statement list plain left recursive. Parsing long equation blocks is now linear instead of quadratic;if/elseblocks with function calls parse up to ~80x faster. SettingMONOLIX2RX_STRICT_AMBIGUITY(as the tests do) makes any remaining grammar ambiguity an error (issue #51).Fixed implicit
ptrdiff_ttointtruncation inrc_dup_str(src/shared.c); pointer differences are now range-checked before conversion toint.Fixed
intindex/column overflow ingetLine(src/parseSyntaxErrors.h): both are nowsize_twith explicit bounds checks before use. The line buffer is nowR_alloc()’d so it is reclaimed if an error longjmps out of the syntax-error highlighter.A syntax error reported on an empty line no longer writes a NUL byte into the error report, which silently cut off the rest of the report.
rc_dup_str()now gives each duplicated string its own allocation. It used to append into one growing buffer, so a reallocation left pointers from earlier calls (held across calls, e.g. both operands of a logical operator) pointing at freed memory.A syntax error’s R error message now includes the highlighted source line and caret. They were only printed to the console because the header written to the error report first suppressed them.
Added thread-safety comment to
src/shared.cdocumenting that the global parser state is intentionally not mutex-protected, consistent with R’s single-threaded execution model.
monolix2rx 0.0.6
CRAN release: 2025-08-29
Updated to add types for rstudio completion
Defensive
drop = FALSEon the importedthetaMatcovariance subset so a single surviving parameter is not collapsed to a scalar.Parameters whose off-diagonal covariances are
NaN/NA/Infare now also dropped from the importedthetaMat(previously only the diagonal was checked forNaN/NA, so non-finite covariances could silently propagate into simulations).When every parameter is dropped from the imported
thetaMat, the covariance information is now ignored with a warning instead of storing a0x0matrix that would breakrxSolve()simulations;rxSolve()also warns whennStud > 1is requested but nothetaMatis available, so uncertainty is never silently omitted.Fixed
rxSolve()fallbacks that readdfObs/thetaMatfrom the wrong location when the values were stored on the model instead of itsmetaenvironment.rxSolve()now actually uses the Monolix-stylemaxSSit reports (number of steady-state doses plus one); previously the computed value was ignored and the literal default10000Lwas passed to the solver. The guard also checkedmissing(maxSS)twice where it meantminSS, so a user-specifiedminSSno longer gets silently overwritten. Note this can change steady-state simulation results: like Monolix itself, a fixed number of doses is now simulated, so slowly accumulating drugs reproduce Monolix’s (possibly pre-steady-state) concentrations instead of being dosed to full steady state; passmaxSS/minSSexplicitly to override.
monolix2rx 0.0.5
CRAN release: 2025-07-15
Updated for new solving option in rxode2 4.0 (and depend on the packages)
Bug fixes for importing models from
lixoftConnectors.
monolix2rx 0.0.3
CRAN release: 2024-10-24
- For initial conditions starting with
rxCov_don’t add to ini
