powered by
Assert all files in vector exist. To assert a single file exists, see assert_file_exists()
assert_file_exists()
assert_all_files_exist( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )
invisible(TRUE) if all files in x exist, otherwise aborts with the error message specified by msg
x
msg
Paths to files (character)
A character string containing the error message if any files in x is does not exist
Only relevant when pooling assertions into multi-assertion helper functions. See cli_abort for details.
Advanced use only. Name of the argument passed (default: NULL, will automatically extract arg_name).
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 })
Run the code above in your browser using DataLab