Learn R Programming

NMproject (version 0.6.9)

apply_manual_edit: Apply a manual edit patch

Description

[Stable]

It is best to allow the "manual edit" RStudio 'Addin' to write this function in your script for you. After a tracked manual edit is performed, a patch file is created and saved in the "patches" subdirectory of nm_dir("models"). This function applies the patch to the object.

Usage

apply_manual_edit(m, patch_id, return_merge_conf_ctl = FALSE)

Value

An nm object with modified ctl_contents field.

Arguments

m

An nm object.

patch_id

Character name of patch. Corresponds to the file name in the "patches" subdirectory of nm_dir("models").

return_merge_conf_ctl

Logical (default = FALSE). If there a merge conflict produced, should the ctl file be returned?

Details

Generally best to to apply patches before automatic edits and changes in directories e.g. via run_in(). If patches are applied to NONMEM control file sections that are likely to change in the future, the patch may fail to apply. In this case, it is best to view the patch (via the "view patch" RStudio 'Addin') and manually re-implement the changes again in a new manual edit.