ferx_model_set_section.RdOverwrites the body of a named section in a .ferx file with new
lines, leaving all other sections untouched. Use this to modify a model
programmatically without opening an editor.
ferx_model_set_section(path, section, lines)path, invisibly.
if (FALSE) { # \dontrun{
# Switch estimation method without opening an editor
ferx_model_set_section("my_model.ferx", "fit_options", c(
" method = focei",
" maxiter = 500",
" covariance = false"
))
# Read-modify-write a section
lines <- ferx_model_section("my_model.ferx", "parameters")
lines <- sub("TVCL\\(.*\\)", "TVCL(0.5, 0.001, 10.0)", lines)
ferx_model_set_section("my_model.ferx", "parameters", lines)
} # }