file_ext: File extension

Description Usage Arguments Details Value See Also Examples

View source: R/file_name_ext.R

Description

Separate file name and extension from a file path

Usage

1
2
3
4
5

Arguments

x

a character vector

Details

If the supplied file name has several extensions, f.ex. like foobar.tar.bz, only the last extension will be considered.

Value

file_ext returns the file extension of each file path. file_name returns the file name, no extension, of each file path. file_name_ext returns both name and extension, but arranged in separate columns of a matrix.

See Also

basename

Examples

1
2
3
4
5
x <- c("/hg/.gi.tar.gz", "ff/hg/hh.pdf", "git", ".History", ".History.log")

file_ext(x)
file_name(x)
file_name_ext(x)

AkselA/R-ymse documentation built on March 21, 2020, 9:52 a.m.