Skip to content


Repository files navigation


AppVeyor build status codecov


The ospsuite-R package provides the functionality of loading, manipulating, and simulating the simulations created in the Open Systems Pharmacology Software tools PK-Sim and MoBi.


If you are reading this on GitHub README, please refer to the online documentation for more details on the package.

In particular, we would recommend that you read the articles in the following order:


The ospsuite package is compatible with R version 3.6.x AND 4.x.x and can be used on Windows and Linux operating systems.

ospsuite is not available on CRAN and also depends on three packages that are not available on CRAN. Thus the installation process is a bit unconventional, please follow carefully the instructions below.

On Windows


The package requires additional software installations:

  • Visual C++ Runtime available here
  • .NET Framework 4.7.2 available here

NB: These pre-requisites are already installed if the OSP Suite was installed before.

From GitHub (recommended)

The latest released version of the package can be installed from GitHub using the {remotes} package. The code below will download and install all the required dependencies.

rClrURL <- if (R.Version()$major >= 4) {
} else {

  repos = NULL,
  type = "binary"


From package archive files

It is also possible to install manually from archive pre-built archive files.

Install CRAN dependencies

When installing from such files, the CRAN dependencies need to be installed manually first.

    # Install dependencies (e.g. R6) which are on CRAN

Install non-CRAN dependencies

Each of the pre-built released packages are available as a a binary *.zip. OSPSuite-R binary archive can be downloaded from here. The other non-CRAN dependencies needed for OSPSuite-R also have to be downloaded and manually installed:

If you use RStudio IDE, you can use the Install option in the Packages pane and select the option Install from -> Package Archive File to install a package from binary *.zip files.

NB: The CRAN dependencies of rClr, ospuite.utils and tlf were already installed during the previous step.

# Install `{rClr}` from local file 
# (`` here should be replaced with the actual path to the `.zip` file)
install.packages(, repos = NULL)

# Install `{ospsuite.utils}` from local file 
# (`` here should be replaced with the actual path to the `.zip` file)
install.packages(, repos = NULL)

# Install `{tlf}` from local file 
# (`` here should be replaced with the actual path to the `.zip` file)
install.packages(, repos = NULL)

# Install `{ospsuite}` from local file
# (`` here should be replaced with the actual path to the `.zip` file)
install.packages(, repos = NULL)

On Linux

The ospsuite package has been tested under Linux distributions CentOS 7 and Ubuntu 18. Some functionality, such as creating individuals or populations, is not available under Linux. Installation under Linux requires several prerequisites, the detailed instructions can be found in the Wiki:

For other Linux distributions Docker containers can be used (Dockerfiles based on CentOS 7 and Ubuntu 18 are available under

Build from source

You can clone the GIT repository and build the package from source.

How to update dependencies from nuget?

  • git submodule update --init --recursive to install all submodules
  • Make sure you have ruby install and that it is available in your path
  • Run rake postclean or simply double click on postclean.bat. This will update all nuget packages and copy the dependencies in the package inst/lib folder.

Known issues

Loading ospsuite might fail if your systems locale is not set to English

Loading the dynamic library for Microsoft .NET runtime...
Loaded Common Language Runtime version 4.0.30319.42000

Error: package or namespace load failed for ‘ospsuite’:
调用: rClr::clrCall(dimensionTask, "AllAvailableUnitNamesFor", enc2utf8(dimension))
错误: Type: System.Collections.Generic.KeyNotFoundException
Message: Dimension 'CV mmHg*s虏/ml' not available in DimensionFactory.

– On Windows, set Settings > Language > Administrative language settings > Current language for non-Unicode programs to English (United States) and reboot. – On Linux, set the environment variable LC_ALL before starting R:

export LC_ALL=en_US.UTF-8

RStudio crashes when trying to load a workspace.

The ospsuite package uses the features implemented in PK-Sim and MoBi by creating .NET objects (e.g. a simulation) and using them from R. These objects cannot be saved as part of the workspace and reloaded on next start. When trying to do so, RStudio simply crashes. There is no possibility to overcome this limitation. To prevent RStudio from crashing, make sure to disable the check-box “Restore .RData into workspace at startup” in the options of RStudio. Keep in mind that you can also change this setting for specific projects.

Code of Conduct

Everyone interacting in the Open Systems Pharmacology community (codebases, issue trackers, chat rooms, mailing lists etc.) is expected to follow the Open Systems Pharmacology code of conduct.


We encourage contribution to the Open Systems Pharmacology community. Before getting started please read the contribution guidelines. If you are contributing to the codebase, please be familiar with the coding standards.


OSPSuite-R is released under the GPLv2 License.

All trademarks within this document belong to their legitimate owners.