Get filename without extension in R

There’s a built in file_path_sans_ext from the standard install tools package that grabs the file without the extension.

tools::file_path_sans_ext("ABCD.csv")
## [1] "ABCD"

Leave a Comment