fileExt | R Documentation |
File extension
fileExt(path, pattern = goalie::extPattern)
path |
|
pattern |
|
character
.
Character vector of same length as path
input, with file extension removed.
Returns NA
if no extension is detected.
This function intentionally doesn't check whether a file exists.
Updated 2022-05-02.
tools::file_ext()
. Note that this returns character()
instead of NA
on extension match failure.
fileExt(c("dir/foo.txt", "dir/bar.tar.gz", "dir/"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.