EnvManager | R Documentation |
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.
wordpredictor::Base
-> EnvManager
new()
It initializes the current object. It simply calls the base class constructor.
EnvManager$new(rp = "../../", ve = 0)
rp
The prefix for accessing the package root folder.
ve
The level of detail in the information messages.
get_data_fn()
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.
EnvManager$get_data_fn(fn, dfn)
fn
The file name.
dfn
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.
remove_files()
Removes all files in the given directory.
EnvManager$remove_files(dn)
dn
The directory name.
td_env()
Removes the ed folder created by the setup_env method. Also sets the R option, "ed" to NULL.
EnvManager$td_env(rf = F)
rf
If the environment folder should be removed.
cp_env()
Copies the ed folder created by the setup_env method to inst/extdata.
EnvManager$cp_env()
setup_env()
Copies the given files from test folder to the environment folder.
EnvManager$setup_env(fns = c(), cf = NULL)
fns
The list of test files to copy
cf
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.
clone()
The objects of this class are cloneable with this method.
EnvManager$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.