Skip to contents

Fetches analysis options from the report yaml applies it to strings.

Usage

fetch_option(rptdetails, option = NULL, fit = NULL, verbose = TRUE)

Arguments

rptdetails

Object creating when reading in rptyaml file

option

String containing the option to fetch (see below)

fit

nlmixr2 fit object to be reported

verbose

Boolean variable when set to TRUE (default) messages will be displayed on the terminal following:

Value

List containing the following information about the output directory

  • "isgood" - Boolean variable indicating success or failure

  • "msgs" - Vector of messages

  • "value" - The value of the option or the default if not specified

Details

The option can be one of the following (default: NULL):

  • "output_dir" - Directory to place figures that are generated (default: tempdir())

  • "resolution" - Resolution of figure files (default: 300)

Examples

library(onbrand)  
obnd = read_template(
 template = system.file(package="nlmixr2rpt", "templates","nlmixr_obnd_template.pptx"),
 mapping  = system.file(package="nlmixr2rpt", "templates","nlmixr_obnd_template.yaml"))

# This will create an example fit object to use in the examples below
fit = fetch_fit_example()

# This reads in the report details as well
rptdetails = yaml_read_fit(
 obnd    = obnd,
 rptyaml = system.file(package="nlmixr2rpt", "examples", "report_fit_test.yaml"),
 fit     = fit)$rptdetails


fetch_option(rptdetails, option="output_dir", fit=fit)
#> $isgood
#> [1] TRUE
#> 
#> $msgs
#> NULL
#> 
#> $value
#> [1] "/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmparONJf/RUNN"
#>