Removes one or more lines in a libbi model.
# S3 method for bi_model
remove_lines(
x,
what,
only,
type = c("all", "assignment", "sample"),
preserve_shell = FALSE,
...
)
the updated bi_model
object
a bi_model
object
either a vector of line number(s) to remove, or a vector of blocks to remove (e.g., "parameter")
only remove lines assigning given names (as a vector of character strings)
which types of lines to remove, either "all", "sample" (i.e., lines with a "~") or "assignment" (lines with a "<-" or "=") (default: "all")
if TRUE (default: FALSE), preserve the definition of a
block even if all lines are removed; this is useful to preserve options
passed to a transition
or ode
block
ignored
bi_model
model_file_name <- system.file(package = "rbi", "PZ.bi")
PZ <- bi_model(filename = model_file_name)
PZ <- remove_lines(PZ, 2)
Run the code above in your browser using DataLab