R/basic-ctl-manipulation.R
insert_dollar.Rd
insert_dollar(m, dollar, text, after_dollar)
An nm object.
Character. Name of subroutine to insert.
Character vector. Text to fill.
Character name of preceding subroutine. The new subroutine will be inserted immediately after it.
An nm object with modified ctl_contents
field.
# 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 <- m1 %>% insert_dollar("MODEL", "
$MODEL
COMP = (CENTRAL)
", after_dollar = "SUB")
m1 %>% dollar("MODEL")
#> $`execute.Models/m1`
#> 1|
#> 2| $MODEL
#> 3| COMP = (CENTRAL)
#>