Description Usage Arguments Value Examples
These functions check whether the directories or files exist and whether the current user has read or write permissions. If a character vector is supplied each element is checked, returning a logical vector of the same length.
1 2 3 4 5 6 7 8 9 | is_file(x)
is_dir(x)
is_readable(x)
is_writeable(x)
is_url(x)
|
x |
(any) The object to test |
TRUE if x is a path to an existing directory, FALSE otherwise
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | is_dir(tempdir())
is_dir("/does/not/exist")
tmpfile <- tempfile()
file.create(tmpfile)
is_file(tmpfile)
is_file("/does/not/exist.txt")
is_readable(tmpfile)
is_readable("/does/not/exist.txt")
is_writeable(tmpfile)
is_writeable("/does/not/exist.txt")
is_url("http://something.com")
is_url("https://google.com")
is_url(c("http://something.com", "https://google.com"))
is_url(1)
is_url("foo")
is_url(NA)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.