Description Usage Arguments Value Examples
The tools package has file_ext
related functions
but the package has to be explicitly loaded (though comes standard with R) and
the file_path_sans_ext
is longer to type. The functions
have been reimported and renamed to aid in their availablity with other path
parsing tools to make their integration seamless (particularly in a pipeable
form).
1 2 3 | file_ext(x)
no_file_ext(x, compression = FALSE)
|
x |
A character vector giving file paths. |
compression |
logical. Should compression extension ‘.gz’, ‘.bz2’ or ‘.xz’ be removed first? |
Returns a character string with just the file extension (file_ext
)
or the path without the file extension (no_file_ext
).
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
library(magrittr)
(r_files <- dir(file.path(R.home(), "doc/manual"), full.names = TRUE))
file_ext(r_files)
no_file_ext(r_files)
r_files %>%
parse_path() %>%
back() %>%
no_file_ext()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.