is_file | R Documentation |
Functions to test for file types
is_file(path, follow = TRUE)
is_dir(path, follow = TRUE)
is_link(path)
is_file_empty(path, follow = TRUE)
path |
A character vector of one or more paths. |
follow |
If |
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.
dir_create("d")
file_create("d/file.txt")
dir_create("d/dir")
link_create(path(path_abs("d"), "file.txt"), "d/link")
paths <- dir_ls("d")
is_file(paths)
is_dir(paths)
is_link(paths)
# Cleanup
dir_delete("d")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.