Skip to contents

The esqlabsRLegacy R-package is designed to facilitate and standardize modeling and simulation (M&S) activities performed in the R environment. The main focus of the package lies on providing standard workflows for running simulations with the Open Systems Pharmacology Software (OSPS) R package ospsuite and creating standardized figures.

General information

This package builds up on the functionality of the ospsuite package. It is strongly recommended to get familiar with the R-Introduction section of the OSPS manual.

In order to load a simulation in R, it must be present in the *.pkml file format. Every simulation in PK-Sim or MoBi can be exported to the *.pkml file. The examples shown in this documentation are based on the Aciclovir example model, until stated otherwise. The model can be found in the PK-Sim examples folder of the OSPS installation. Alternatively, you can also download it from here.

The documentation is divided into two parts covering the following aspects:

Object-oriented approach

The esqlabsRLegacy package utilizes the concept of object-oriented (OO) programming based on the R6 system. While the philosophy of the package is to offer a functional programming workflow more common for the R users, it is important to understand some basic concepts of the OO programming. Many of the functions implemented in esqlabsRLegacy return an instance (or an object) of a class. These objects can be used as inputs for other methods. Additionally, each object offers a set of properties (which can be other objects) and methods, which are accessible by the $ sign:

# create an instance of an object
object1 <- ClassName$new()

# extract a property associated with this object
aProperty <- object1$property1

# apply a method associated with this object
resultOfAFunction <- object1$multiply(1,2)

Important information about the object can be printed out by calling print(object).

The most important classes are:
DataMapping
Organizes objects of type XYData, describing their groupings and used for creating figures. See Creating figures for more information.
Plotable
XYData, inherits Plotable
Organizes any kind of x-y-values data. See Data handling for more information.
DataConfiguration
Structure containing information for observed data import. See Data handling for more information.