[Stable]

Staging is a preliminary step of bringing code from external to the project into the project. The intent is it remains a snapshot of code as it was at the time of importing. This aids in reproducibility because if that external code is changed, the staged code will remain fixed.

In practice, this function will rarely need to be used directly. The easiest way to bring code is via the "code library" RStudio 'Addin' shiny app.

stage(
  files,
  root_dir,
  overwrite = FALSE,
  silent = FALSE,
  find_replace_dir_names = TRUE
)

Arguments

files

Character vector. path of files to stage.

root_dir

Character path to root directory of files. Staged files relative to staging directory will be same as files to root_dir. If this is not specified, will guess based on presence of nm_default_dirs

overwrite

Logical (default = FALSE).

silent

Logical (default = FALSE).

find_replace_dir_names

Logical (default = TRUE). Will attempt to find replace strings in scripts to reflect nm_default_dirs().

Value

A tibble with staged file information.

Examples


## requires NMproject directory structure
if (FALSE) {

ls_code_library("Models/ADVAN2.mod") %>%
  stage()
}