| 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)
rpThe prefix for accessing the package root folder.
veThe 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)
fnThe file name.
dfnThe 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)
dnThe 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)
rfIf 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)
fnsThe list of test files to copy
cfA 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)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.