add_reg_folders sets options('nat.templatebrains.regdirs') appropriately so that registrations can be found by e.g. xform_brain.

extra_reg_folders lists extra registration folders present in standard location

add_reg_folders(dir = extra_reg_folders(), first = TRUE)

extra_reg_folders(full.names = TRUE)

Arguments

dir

Path to one or more folders containing registrations. Default value will scan for registration folders in a standard location. (Please see Details and File layout sections)

first

Whether the new folder should be added to the start (default) or end of the search list.

full.names

Whether to list full path to registration folders

Value

This function is principally called for its side effect. A path to the location on disk containing added registrations is returned invisibly.

Details

When dir is unset then it will default to the value of extra_reg_folders() i.e. any folders / cloned repositories in the standard location

File layout

You must pass a folder containing one or more registrations, not the registration folder itself. So if you have this situation on disk

  • myregistrations/

  • myregistrations/reg1.list

  • myregistrations/reg2.list

you should write add_reg_folders("/path/to/myregistrations")

Examples


if (FALSE) {
  add_reg_folders("myextraregistrations")
}
# adding a non-existent folder will generate an error
tools::assertError(add_reg_folders(tempfile()))