Functions to test for file types

is_file(path, follow = TRUE)

is_file_empty(path, follow = TRUE)

## Arguments

path A character vector of one or more paths. If TRUE, symbolic links will be followed (recursively) and the results will be that of the final file rather than the link.

## Value

A named logical vector, where the names give the paths. If the given object does not exist, NA is returned.

file_exists(), dir_exists() and link_exists() if you want to ensure that the path also exists.

## Examples

.old_wd <- setwd(tempdir())
dir_create("d")

file_create("d/file.txt")
dir_create("d/dir")
setwd(.old_wd)