View source: R/checkDirectoryExists.R
| checkDirectoryExists | R Documentation |
Check for existence and access rights of directories
checkDirectoryExists(x, access = "")
check_directory_exists(x, access = "")
assertDirectoryExists(x, access = "", .var.name = vname(x), add = NULL)
assert_directory_exists(x, access = "", .var.name = vname(x), add = NULL)
testDirectoryExists(x, access = "")
test_directory_exists(x, access = "")
expect_directory_exists(x, access = "", info = NULL, label = vname(x))
checkDirectory(x, access = "")
assertDirectory(x, access = "", .var.name = vname(x), add = NULL)
assert_directory(x, access = "", .var.name = vname(x), add = NULL)
testDirectory(x, access = "")
test_directory(x, access = "")
expect_directory(x, access = "", info = NULL, label = vname(x))
x |
[ |
access |
[ |
.var.name |
[ |
add |
[ |
info |
[ |
label |
[ |
Depending on the function prefix:
If the check is successful, the functions
assertDirectoryExists/assert_directory_exists return
x invisibly, whereas
checkDirectoryExists/check_directory_exists and
testDirectoryExists/test_directory_exists return
TRUE.
If the check is not successful,
assertDirectoryExists/assert_directory_exists
throws an error message,
testDirectoryExists/test_directory_exists
returns FALSE,
and checkDirectoryExists/check_directory_exists
return a string with the error message.
The function expect_directory_exists always returns an
expectation.
The functions without the suffix “exists” are deprecated and will be removed from the package in a future version due to name clashes.
Other filesystem:
checkAccess(),
checkFileExists(),
checkPathForOutput()
# Is R's home directory readable?
testDirectory(R.home(), "r")
# Is R's home directory readable and writable?
testDirectory(R.home(), "rw")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.