File extension
Usage
fileExt(path, pattern = goalie::extPattern)Value
character.
Character vector of same length as path input, with file extension removed.
Returns NA if no extension is detected.
See also
tools::file_ext(). Note that this returns character() instead of NA
on extension match failure.
Examples
fileExt(c("dir/foo.txt", "dir/bar.tar.gz", "dir/"))
#> [1] "txt" "tar.gz" NA