Description Usage Arguments Examples
Useful test related to files
1 2 3 4 5 6 7 | is.dir(path)
is.writeable(path)
is.readable(path)
has_extension(path, ext)
|
path |
a file path to examine |
ext |
extension to test for ( |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | see_if(is.dir(1))
tmp <- tempfile()
see_if(file.exists(tmp))
see_if(is.dir(tmp))
writeLines("x", tmp)
see_if(file.exists(tmp))
see_if(is.dir(tmp))
see_if(is.writeable(tmp))
see_if(is.readable(tmp))
unlink(tmp)
see_if(is.readable(tmp))
|
[1] FALSE
attr(,"msg")
[1] "path is not a string (a length one character vector)."
[1] FALSE
attr(,"msg")
[1] "Path '/work/tmp/tmp/Rtmpxd6Iaa/file62264968ac89' does not exist"
[1] FALSE
attr(,"msg")
[1] "Path '/work/tmp/tmp/Rtmpxd6Iaa/file62264968ac89' does not exist"
[1] TRUE
[1] FALSE
attr(,"msg")
[1] "Path '/work/tmp/tmp/Rtmpxd6Iaa/file62264968ac89' is not a directory"
[1] TRUE
[1] TRUE
[1] FALSE
attr(,"msg")
[1] "Path '/work/tmp/tmp/Rtmpxd6Iaa/file62264968ac89' does not exist"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.