View source: R/low-level-ctl-handling-funs.R
gsub_ctl | R Documentation |
A wrapper around gsub
so that control files may be modified using gsub
syntax. Can be useful for simple find replace operations in a control
stream. Ensure you use the "view diff" app afterwards to make sure the find
replace proceeded as intended.
gsub_ctl(m, pattern, replacement, ..., dollar = NA_character_)
m |
An nm object. |
pattern |
Argument passed to |
replacement |
Argument passed to |
... |
Additional arguments passed to |
dollar |
Character name of subroutine. |
An nm object with modified ctl_contents
field.
apply_manual_edit()
# 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("EST") m1 <- m1 %>% gsub_ctl("ISAMPLE=300", "ISAMPLE=600") m1 %>% dollar("EST")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.