Learn R Programming

assertive.files (version 0.0-2)

assert_all_are_existing_files: Does the file exist?

Description

Checks to see if the input files exist.

Usage

assert_all_are_existing_files(x, severity = getOption("assertive.severity", "stop"))
assert_any_are_existing_files(x, severity = getOption("assertive.severity", "stop"))
is_existing_file(x, .xname = get_name_in_parent(x))

Arguments

x
Input to check.
severity
How severe should the consequences of the assertion be? Either "stop", "warning", "message", or "none".
.xname
Not intended to be used directly.

Value

is_existing_file wraps file.exists, showing the names of the inputs in the answer. assert_*_are_existing_files return nothing but throws an error if is_existing_file returns FALSE.

See Also

file.exists.

Examples

Run this code
assert_all_are_existing_files(dir())
# These examples should fail.
assertive.base::dont_stop(
  assert_all_are_existing_files("not an existing file (probably)")
)

Run the code above in your browser using DataLab