Skip to contents

Function as `basename()` with the option to not return the file extension.

Usage

GetFileName(path.pth = NULL, ext.bln = FALSE)

Arguments

path.pth

<character>: the path to the file.

ext.bln

<logical>: whether the file extension should be returned with the file name. (Default FALSE)

Value

A character string.

Details

GetFileName

Examples

filePath.pth ="my/path/to/my/file.txt"
GetFileName(path.pth=filePath.pth, ext.bln=FALSE)
#> [1] "file"
GetFileName(path.pth=filePath.pth, ext.bln=TRUE)
#> [1] "file.txt"