On the use of the R-functions
We now propose to use Simulx via R-functions. The package lixoftConnectors provides access to the project exactly in the same way as you would do with the interface. All the installation guidelines and initialization procedure can be found here. All the functions are described below.
Examples
- Page with all examples
- Load a project and run the simulation
- Import a Monolix project and simulate a new output variable with the EBEs
- Create a Simulx project from scratch and simulate covariate-dependent treatments
- Import a Monolix project and simulate with new output times
- Run a simulation with different sample sizes and plot the power of the study based on an endpoint
Description of the functions concerning the element definition
- defineCovariateElement: Define a new covariate element.
- defineIndividualElement: Define a new individual element.
- defineOccasionElement: Define a new occasion element.
- defineOutputElement: Define a new output element.
- definePopulationElement: Define a new population element.
- defineRegressorElement: Define a new regression element.
- defineTreatmentElement: Define a new treatment element.
- deleteElement: Delete an element of any type.
- deleteOccasionElement: Delete the occasion element.
- getCovariateElements: Get the list of all available covariate elements for the exploration and simulation.
- getIndividualElements: Get the list of all available individual elements for the exploration and simulation.
- getOccasionElements: Get the list of the occasion element for the simulation.
- getOutputElements: Get the list of all available output elements for the exploration and simulation.
- getPopulationElements: Get the list of all available population elements for the simulation.
- getRegressorElements: Get the list of all available regressor elements for the exploration and simulation.
- getTreatmentElements: Get the list of all available treatments elements for the exploration and simulation.
Description of the functions concerning the project management
- getStructuralModel: Get the model file for the structural model used in the current project.
- isProjectLoaded: Check if the project is loaded
. - loadProject: Load a project by parsing the Mlxtran-formated file whose path has been given as an input.
- newProject: Create a new empty project providing model and data specification.
- saveProject: Save the current project as an Mlxtran-formated file.
Description of the functions concerning the project management specific to Simulx
- getAddLines: Get the lines that were added to a model.
- importMonolixProject: Import all the elements coming from a Monolix project.
- setAddLines: Lines that can be added to the model file.
Description of the functions concerning the results
- exportSimulatedData: Export the simulated data set into Lixoft suite compatible format.
- getSimulationResults: Get the results of the simulation.
Description of the functions concerning the scenario
- computeChartsData: Compute and export the charts data of scenario.
Description of the functions concerning the scenario specific to Simulx
- addGroup: Add a new simulation group.
- getGroupRemaining: Get the values of the remaining elements (coming from the observation model) for a group.
- getGroups: Get the structure of each simulation group.
- getNbReplicates: Get the number of replicates.
- getSameIndividualsAmongGroups: Get the informations if the same individuals are simulated among all groups.
- getSamplingMethod: Define which sampling methods is used for the simulation.
- getSharedIds: Get the elements for the shared group.
- removeGroup: Remove a simulation group.
- removeGroupElement: Remove an element of the simulation.
- renameGroup: Rename a simulation group.
- runSimulation: Run the simulation task.
- setGroupElement: Set the new element of a specific group.
- setGroupRemaining: Set the values of the remaining elements (coming from the observation model) for a group.
- setGroupSize: Define the size of a simulation group.
- setNbReplicates: Define the number of replicates of the simulation.
- setSameIndividualsAmongGroups: Define if the same individuals will be simulated among all groups.
- setSamplingMethod: Define which sampling methods will be used for the simulation.
- setSharedIds: Set the elements for the shared group.
Description of the functions concerning the settings and preferences
- getPreferences: Get a summary of the project preferences.
- getProjectSettings: Get a summary of the project settings.
- setPreferences: Set the value of one or several of the project preferences.
- setProjectSettings: Set the value of one or several of the settings of the project
Handling of warning/error/info messages
Error, warning and info messages from Monolix are displayed in the R console when performing actions on a monolix project. They can be hidden via the R options. Set lixoft_notificationOptions$errors
, lixoft_notificationOptions$warnings
and lixoft_notificationOptions$info
to 1 or 0 to respectively hide or show the messages.
Example
op = options() op$lixoft_notificationOptions$warnings = 1 #hide the warning messages options(op)