Skip to contents

Function to generate the four files required in the target package (i.e. the package that should be enabled to use the package 'uniset').


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



Character length one. The name 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 location where the folder with the resulting four files should be copied to. Defaults to 'NULL'. If left at the default 'NULL', the location should be selectable interactively. Provide a character length one holding a valid path to an existing folder to copy the folder containing the four required files there.


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'.


Creates a folder at the location specified at argument 'where' with the four files to be moved into the target package in it. Returns an (invisible) character holding the path of the folder where the three files were written into.


Look at the content of the four generated files for information on where they should be moved.


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


# 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
uniset_getFiles("dogPack", setupFunc="nameOfSetupFunc", where=to)
# Now manually move the four files according to the instructions contained 
# in them.
#> Three files called 
#> 'uniset_globals.R'
#> 'dogPack_settings.R'
#> 'uniset_functions.R'
#> have been written to the folder 
#> '/var/folders/lz/7rwkvs09671dzp_fgvtxyrqh0000gq/T//RtmprWG2ky/UnisetFiles_R-pkg_'dogPack''
#> Please move these three files into their resp. target folders 
#> (see ?uniset, or have a look at the content of the three generated files)
#> Use the function 
#> 'autoUpS()' or 'getstn()'
#> inside a function defined in the package 'dogPack' to get the list holding the key=value pairs.