Save the list of named arguments given in ... to an RData file args_<functionName>_<hhmmss>_<no>.RData in the directory given in targetdir. This function can be used to log the inputs given to a function together with the result returned by the function. test_function can then be used to check whether another version of the function (e.g. obtained by code cleaning) can reproduce the stored results from the stored arguments. Check out the example on the help page for test_function.

saveArgs(
  functionName,
  ...,
  targetdir = kwb.utils::createDirectory(file.path(tempdir(), "test"))
)

Arguments

functionName

name of the function to which the arguments to be saved belong. It will be used to generate a file name for the RData file.

...

named arguments representing the arguments that have been given to the function functionName.

targetdir

directory in which to store the objects given in ... Default: subdirectory test in tempdir()

Value

path to the file written (invisibly)

See also