dollar: Get/set existing subroutine

View source: R/basic-ctl-manipulation.R

dollarR Documentation

Get/set existing subroutine

Description

[Stable]

The fast way to see the contents of a particular subroutine directly in the R console. It can also be used to set the contents of a NONMEM subroutine in place of manual edits

Usage

dollar(m, dollar, ..., add_dollar_text = TRUE)

Arguments

m

An nm object.

dollar

Character. Name of NONMEM subroutine to target.

...

Additional arguments to be passed to text(). If specified these will set the contents of the subroutine. See examples below.

add_dollar_text

Logical (default = TRUE). Should the $XXXX string be added to text.

Value

If dollar is specified returns the relevant subroutine of the control file as a character. Otherwise returns an nm object with modified ctl_contents field.

See Also

insert_dollar(), delete_dollar()

Examples


# create example object m1 from package demo files
exdir <- system.file("extdata", "examples", "theopp", package = "NMproject")
m1 <- new_nm(run_id = "m1", 
             based_on = file.path(exdir, "Models", "ADVAN2.mod"),
             data_path = file.path(exdir, "SourceData", "THEOPP.csv"))

m1 %>% dollar("PK") ## displays existing $PK

m1 %>% dollar("THETA")

c(m1, m1) %>% dollar("THETA") # display $THETAs for multiple NONMEM runs


tsahota/NMproject documentation built on Oct. 1, 2022, 11:51 a.m.