RsSimulx

RsSimulx is an additional R package which offers two main functionalities:

  • provide a wrapper around the lixoftConnectors for Simulx, with a more compact syntax than the lixoftConnectors
  • replaces the simulx() function of the deprecated package mlxR

More information:

  • Versions and change log
  • simulx – to run a simulation
  • prctilemlx – to plot prediction intervals (with overlay of the groups on a single plot)
  • writeData – to write the simulation results in a MonolixSuite compatible format – available directly in the interface and in the lixoftConnectors with exportSimulatedData

Installation

RsSimulx is available on CRAN but it requires the lixoftConnectors package which is provided within the MonolixSuite installation.

Follow these steps, described in more detail below:

  1. Install MonolixSuite
  2. Install lixoftConnectors dependancies (RJSONIO, ggplot2, and grixExtra)
  3. Install lixoftConnectors
  4. Install RsSimulx

Installation of dependancies (from CRAN)

install.packages('RJSONIO')
install.packages('ggplot2')
install.packages('gridExtra')

Installation of the lixoftConnectors

The installation package is located in the MonolixSuite installation directory. The default path to the installation directory differs between operating systems. You may have to adapt the path if you have chosen another installation directory. More details, including installing older versions, can be found at the lixoftConnectors installation page.

# for Windows OS
install.packages("C:/Program Files/Lixoft/MonolixSuite2024R1/connectors/lixoftConnectors.tar.gz", 
                 repos = NULL, type="source", INSTALL_opts ="--no-multiarch")
# for Mac OS
install.packages("/Applications/MonolixSuite2024R1.app/Contents/Resources/\
                  monolixSuite/connectors/lixoftConnectors.tar.gz",
                  repos = NULL, type="source", INSTALL_opts ="--no-multiarch")

Installation of RsSimulx

install.packages("RsSimulx", INSTALL_opts ="--no-multiarch")

Compatibility

  • RsSimulx 2024.1 is compatible with MonolixSuite 2024R1.
  • RsSimulx 2023.1 is compatible with MonolixSuite 2023R1.
  • RsSimulx 2.0.0 is compatible with MonolixSuite 2021R2 and 2021R1.
  • RsSimulx 1.0.1 is compatible with MonolixSuite 2020.

Change log

Version 2024.1 (released on CRAN on June 10th 2024)

This version is compatible with MonolixSuite version 2024. The lixoftConnectors 2024 should be installed first.

  • Added setting regressorInterpolationMethod to simulx to choose between last carried forward or linear interpolation for regressors.
  • Fixed bug where group could be converted to numeric in writeData.
  • Added error in the case of version mismatch among RsSimulx, lixoftConnectors, and MonolixSuite.

Version 2023.1 (released on CRAN on April 20th 2023)

This version is compatible with MonolixSuite version 2023. The lixoftConnectors 2023 should be installed first.

  • In case of simulations using elements defined via external files, output will contain a column “original_id” indicating id of individuals in external files.
  • Versioning was changed to be consistent with lixoftConnectors and MonolixSuite versioning.

Version 2.0.0 (released on CRAN on February 18th 2022)

This version is compatible with MonolixSuite version 2021. The lixoftConnectors 2021 should be installed first.

In this version, new functionalities already available in the GUI were added and the syntax has been slightly changed to be consistent with the display in the GUI.

The main changes in the simulx() function are summarized below:

  • parameter:
    • accept only pop param and indiv param (and ‘remaining parameters’). No covariates anymore, use the “covariate” argument instead.
    • accept strings corresponding to the elements automatically generated after an import:”mlx_Pop”, “mlx_PopUncertainSA”, “mlx_PopUncertainLin”, “mlx_PopIndiv”, “mlx_PopIndivCov”,”mlx_CondMean”,”mlx_EBEs”,”mlx_CondDistSample”
    • deprecated: “mode” and “mean” (use the keyword above instead)
  • covariate:
    • accepts covariates elements as lists (same value for all individuals), data frames or path to text file
    • accept strings corresponding to the elements automatically generated after an import: “mlx_Cov” and “mlx_CovDist”
  • treatment:
    • accept string corresponding to the elements automatically generated after an import: “mlx_admXXX”
    • new options “repeats” and “probaMissDose”
  • varlevel:
    • deprecated and now called “occasion”
  • nrep:
    • now samples with or without uncertainty depending which element is given as “parameter”
  • stat.f, data, result_folder et les settings load.design, data.in, disp.iter:
    • have been removed
  • npop and fim:
    • deprecated: use nrep and “mlx_PopUncertainSA” or “mlx_PopUncertainLin” instead
  • settings:
    • “kw.max”: deprecated
    • “replacement”: has been replaced by “samplingMethod” with values “keepOrder”, “withReplacement”, “withoutReplacement”
    • new option “sameIndividualsAmongGroups”: true/false
    • new option “sharedIds”: vector of strings among covariate, output, treatment, regressor, population, individual.
    • new option “exportData”: true/false
  • saveSmlxProject:
    • save the .smlx project to the specified path.

Known limitations:

  • when just resimulating a Monolix project, the individuals having no observations for some obs ids (in case of several observation identifiers) or no dose will be missing from the simulation.
  • it is not possible to retrieve the original IDs when using data frames with id column as input

Version 1.0.1 (released on CRAN on April 8th 2021)

This version corrects several bugs and is compatible with MonolixSuite version 2020.

  • The initialization of the lixoftConnectors (i.e linking to the MonolixSuite installation folder) is now done on the first call to simulx() instead of the loading of the RsSimulx package.
  • The new function initRsSimulx(path=…) allows to indicate a path to the MonolixSuite installation folder when the <home>/lixoft/lixoft.ini file is missing or needs to be bypassed.
  • Messages, warnings and errors raised by the lixoftConnectors are now propagated to RsSimulx such that the user can see them.
  • Columns “type” or “adm” for treatments defined as data.frames are now properly recognized (they where previously ignored).
  • When both population parameters and covariates are given in the “parameter=” argument of simulx(), the covariates are now properly taken into account (they were previously ignored).
  • The seed given to simulx() now propagates to simpopmlx, which is sampling the population parameters when using the argument “npop” (previously the reproducibility was not ensured when using npop).
  • The use of a named vector with only characters (typically in the case of categorical-only covariates defined as strings) does not generate an error any more.
  • When population parameters are defined as a data.frame with a column “pop”, the dataframe is now used with the correct number of rows (it was previously cut or replicated to match the npop argument).
  • When npop is used but no treatment is present, no error is raised anymore.
  • When the “parameter” argument is defined as a named vector with both characters (for categorical covariates for instance) and numerical values, no error is raised anymore.

Known issues remaining in version 1.0.1:

  • regressor values are not outputted from simulx()
  • when just resimulating a Monolix project, in case of both continuous and non-continuous outputs, only the continuous outputs are outputted.

Version 1.0.0 (released on CRAN on January 21st 2021)

RsSimulx is compatible with the MonolixSuite version 2020. It provides retro-compatibility of old mlxR scripts and functions to complement the use of Simulx-GUI (writeData(), prctilemlx() and simpopmlx()).

[/vc_column_text][/vc_column][/vc_row]

modal close image