RsSimulx for retrocompatibility of mlxR scripts

RsSimulx contains a function simulx() which works in the same way as the simulx() function of the mlxR package. To use your scripts initially developed with mlxR with MonolixSuite 2020, 2021 and 2023, you need to replace library(mlxR) by library(RsSimulx) and run the rest of your script as before.

Removed features

A few functions and features which were available in the mlxR package are not available in the RsSimulx package anymore, due to technical constrains. They are listed below.

  • the following functions have been removed:
    • pkmodel()
    • monolix2simulx()
    • readDataMlx()
  • the following arguments have been removed from the simulx() function
    • in “treatment=”, the “target” field is not accepted anymore. Use “adm” instead.
    • in “group=”, the “level” field is not accepted anymore, unless it is equal to “individual”. With RsSimulx, the variability is always at the individual level.
  • The following outputs have been removed:
    • originalID data frame (but originalID is now part of result tables returned by getSimulationResults() in tables of individual parameters and outputs next to the ID column, and as a separate table ID_mapping if external elements have been used)

Modifications requiring small code adaptations

  • the individual parameters are covariates are now outputted by default in the ‘parameter’ argument. It is not necessary to request them explicitly.
  • the writeDataMlx() function has been replaced by the function exportsimulatedData() which is called without R object as input. When called just after a simulx() call, it will use the simulx project in memory to write the data set. Note that the ‘loq’ will not be taken into account.
  • overlapping occasions are now supported but when the occasion element has an id column, all elements must follow this occasions structure. See the occasion definition in Simulx-GUI for more details.
  • for time-to-event outputs, it is now required to give a vector of two times (start and end of the observation period) instead of only the start time:
    out <- list(name="Event", time=c(0, 400))
  • Negative amount with positive infusion rates are not possible anymore. Use the reset or empty macros instead.
  • it is not possible to define distributions in the [COVARIATE] or [POPULATION] block anymore. Instead, sample the covariates or population parameters in the R script and provide them as a data frame.
  • in the model, to properly identify covariates, individual parameters and population parameters, they must be declared in the corresponding block. The model structure is detailed on the mlxtran page.

Reproducibility

Running the same script with RsSimulx or mlxR will lead to different simulated values because the seed is read in a different way by the two packages. When running the same script several times with RsSimulx, the simulated values will be the same.

modal close image