Skip to contents

Generate the four files required in the target package (i.e. the package that should be enabled to use the package 'uniset'). The generated files will be copied directly into their required destination folders in the target package. The name of the target package will be extracted from the description file.


  setupFunc = NULL,
  taPaSH = "def",
  taPaObj = "settings",
  tmpl = "_TEMPLATE"



Character length one. The path to the root of the target package.


Character length one. The name of the function in the target package that is containing the setup-function uniset_setup.


Character length one. The name of the variable to be defined in the '.Renviron' file, leading to the place where the settings.R file for the target package will be stored. If left at the default 'def', 'taPaName_SH' will be used, with 'taPaName' being the value provided at the argument 'taPaName'.


Character length one. The name of the object holding the list with the key-value pairs that can be defined to be used in the target package. Can be left at the default 'settings'.


Character length one. the Character string that will be appended to the fresh settings file that is copied (by the target package) to the users settings home directory if updating the key=value pairs was not successful. Can be left at the default '_TEMPLATE'.


Writes the four required files directly into a valid R-package folder structure. Returns (invisible) NULL.


Please refer to uniset for a link to examples and a real-world demo.

See also


# first copy the target package example into tempdir
to <- tempdir()
from <- paste0(path.package("uniset"), "/examples/dogPack")
file.copy(from, to, recursive = TRUE) 
# now copy the four required files directly into the package 'dogPack'
path <- paste0(to, "/dogPack")
uniset_copyFilesToPackage(path, "nameOfSetupFunc")
#> A file called 'dogPack_settings.R' has been written into the 'inst' folder, 
#> two files called 'uniset_globals.R' and 'uniset_functions.R'
#> have been written into the 'R' folder of the package 'dogPack' at
#> '/var/folders/lz/7rwkvs09671dzp_fgvtxyrqh0000gq/T//RtmprWG2ky/dogPack'.
#> Use the function 
#> 'autoUpS()' or 'getstn()'
#> inside a function defined in the package 'dogPack' to get the list holding the key=value pairs.