I have an R script that takes a file as input, and I want a general way to know whether the input is a file that exists, and is not a directory.
In Python you would
You can also use is_file(path) from the fs package.
is_file(path)
fs