is_file {msgr} | R Documentation |
Checks whether the variable is a path to an existing file
is_file(x)
x |
(any) The object to test |
TRUE if x is a path to an existing file, FALSE otherwise
tmpfile <- tempfile()
file.create(tmpfile)
is_file(tmpfile)
is_file("/does/not/exist.txt")
is_file(1)