getOutputValues: Extracting simulated values

View source: R/utilities-simulation-results.R

getOutputValuesR Documentation

Extracting simulated values

Description

The function receives an object of simulation results generated by running the simulation and returns time-values profiles for the chosen quantities. Results of a simulation of a single individual is treated as a population simulation with only one individual.

Usage

getOutputValues(
  simulationResults,
  quantitiesOrPaths = NULL,
  population = NULL,
  individualIds = NULL,
  stopIfNotFound = TRUE,
  addMetaData = TRUE
)

Arguments

simulationResults

Object of type SimulationResults produced by calling runSimulations on a Simulation object.

quantitiesOrPaths

Quantity instances (element or vector) typically retrieved using getAllQuantitiesMatching or quantity path (element or vector of strings) for which the results are to be returned. (optional) When providing the paths, only absolute full paths are supported (i.e., no matching with '*' possible). If quantitiesOrPaths is NULL (default value), returns the results for all output defined in the results.

population

population used to calculate the simulationResults (optional). This is used only to add the population covariates to the resulting data table.

individualIds

numeric IDs of individuals for which the results should be extracted. By default, all individuals from the results are considered. If the individual with the provided ID is not found, the ID is ignored.

stopIfNotFound

If TRUE (default) an error is thrown if no results exist for any path. If FALSE, a list of NA values is returned for the respective path.

addMetaData

If TRUE (default), the output is a list two sublists dataand metaData, with latter storing information about units and dimensions of the outputs. If FALSE, metaData is NULL. Setting this option to FALSE might improve the performance of the function.

Value

Returns the simulated values for the selected outputs (e.g molecules or parameters).

Examples

library(ospsuite)

simPath <- system.file("extdata", "simple.pkml", package = "ospsuite")
sim <- loadSimulation(simPath)

# Running an individual simulation
# results is an instance of `SimulationResults`
results <- runSimulations(sim)[[1]]

getOutputValues(results)

Open-Systems-Pharmacology/OSPSuite-R documentation built on Feb. 14, 2025, 4:48 p.m.