add_reg_folders: Set or list local folders containing registrations for nat.templatebrains
Description
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
Usage
add_reg_folders(dir = extra_reg_folders(), first = TRUE)
extra_reg_folders(full.names = TRUE)
Value
This function is principally called for its side effect. A path to
the location on disk containing added registrations is returned invisibly.
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
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")
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
if (FALSE) {
add_reg_folders("myextraregistrations")
}
# adding a non-existent folder will generate an errortools::assertError(add_reg_folders(tempfile()))