assert_all_files_exist | R Documentation |
Assert all files in vector exist. To assert a single file exists, see assert_file_exists()
assert_all_files_exist(
x,
msg = NULL,
call = rlang::caller_env(),
arg_name = NULL
)
x |
Paths to files (character) |
msg |
A character string containing the error message if any files in |
call |
Only relevant when pooling assertions into multi-assertion helper functions. See cli_abort for details. |
arg_name |
Advanced use only. Name of the argument passed (default: NULL, will automatically extract arg_name). |
invisible(TRUE) if all files in x
exist, otherwise aborts with the error message specified by msg
real_file <- system.file("DESCRIPTION", package = "assertions")
try({
assert_all_files_exist(c(real_file, real_file))
assert_all_files_exist(c("foo", "bar")) # Throws Error
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.