Skip to contents

Perform the required setup to enable the target package to make use of the functionality of package 'uniset'. Only has to be called once by the user of the target package.

Usage

uniset_setup(where = NULL, uniset_handover)

Arguments

where

Character length one, holding the path to the location where the folder containing the settings.R file should be located. Defaults to 'NULL'. If left at the default 'NULL', the location should be selectable interactively.

uniset_handover

List length two, containing two elements:

  1. pkgname: The name of the target package.

  2. funcname: The name of the function in the target package handing over the required values. See examples at uniset.

Value

Called for its side effects, i.e. to initiate the dynamic settings file system (see Details.) Returns an (invisible) character length one holding the path to the settings-home directory.

Details

This function is intended to be called from within the target package by the user of the target package. Only has to be called once to initiate the system, i.e. to

  • Define the folder where the settings.R file will be located,

  • Copy the settings.R file into this folder, and

  • Create a corresponding entry in the .Renviron file (or create the .Renviron file if does not exist).

This setup has to be done manually (but only once!) by the user of the target package. However, if called repeatedly, it enables the user of the target package to conveniently change the settings-home directory and its corresponding variable in the .Renviron file. In that case, a factory-fresh version of the settings.R file will be copied into the new settings-home directory. For the user-defined values in the 'old' settings.R file not to be lost, the user then has to manually move / copy the settings from the old location to the new one.

Important

This function is meant to be called from within the target package.

Examples

{
if (FALSE) {
# to be called from within the target package
uniset_setup(where, uniset_handover)
}
}