This class provides a method for creating directories in the tempdir folder for testing purposes. It also provides a method for reading files from the inst/extdata folder.
It initializes the current object. It simply calls the base class constructor.
EnvManager$new(rp = "../../", ve = 0)
The prefix for accessing the package root folder.
The level of detail in the information messages.
Checks if the given file exists. If it does not exist, then it tries to load the file from the inst/extdata data folder of the package. It throws an error if the file was not found. If the file exists, then the method simply returns the file name.
The file name.
The name of the default file in the external data folder of the package.
The name of the file if it exists, or the full path to the default file.
Removes all files in the given directory.
The directory name.
Removes the ed folder created by the setup_env method. Also sets the R option, "ed" to NULL.
EnvManager$td_env(rf = F)
If the environment folder should be removed.
Copies the ed folder created by the setup_env method to inst/extdata.
Copies the given files from test folder to the environment folder.
EnvManager$setup_env(fns = c(), cf = NULL)
The list of test files to copy
A custom environment folder. It is a path relative to the current directory. If not specified, then the tempdir function is used to generate the environment folder.
The list of folders that can be used during testing.
The objects of this class are cloneable with this method.
EnvManager$clone(deep = FALSE)
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.