Skip to contents

Defines infusion rates specified in the system file using <R:?>

Usage

system_set_rate(cfg, rate, times, levels)

Arguments

cfg

ubiquity system object

rate

name of infusion rate

times

list of time values

levels

corresponding list of infusion values

Value

Ubiquity system object with the infusion rate set

Examples

# \donttest{
# Creating a system file from the mab_pk example
fr = system_new(file_name        = "system.txt", 
                system_file      = "mab_pk", 
                overwrite        = TRUE, 
                output_directory = tempdir())

# Building the system 
cfg = build_system(system_file  = file.path(tempdir(), "system.txt"),
      output_directory          = file.path(tempdir(), "output"),
      temporary_directory       = tempdir())
#> 
#> ── Building the system: /var/folders/l9/6pm7xq5j1hn6l00zrs22j6mc0000gn/T//RtmpoL
#> → ubiquity:     https://r.ubiquity.tools
#> → Distribution: package (2.0.4)
#> → Compiling C version of system
#> → Loading the shared C library
#>  System built
#>  To fetch a new analysis template use `system_fetch_template`
#>  For example:
#>    fr = system_fetch_template(cfg, template = "Simulation")
#>    fr = system_fetch_template(cfg, template = "Estimation")

# Clearing all inputs
cfg = system_zero_inputs(cfg)

# 5 minute infusion at 10 mg/min
cfg = system_set_rate(cfg,
           rate   = "Dinf",
           times  = c(0,  5), 
           levels = c(10, 0))
# }