Check if a file exists
check_file.RdInternal helper function to verify if an input string corresponds to an existing file.
Value
Logical. Returns TRUE if x is a valid file path and the file exists.
Returns FALSE if x is not a valid string or the file does not exist.
Examples
if (FALSE) { # \dontrun{
if (interactive()) {
check_file("path/to/existing_file.txt") # TRUE if file exists
check_file("nonexistent_file.txt") # FALSE
}
} # }