path_basename: Base name of pathname path

Description Usage Arguments Details Value See Also Examples

View source: R/simple.R

Description

The result is the same as for basename, and this function is only included here for completeness.

Usage

1

Arguments

path

Character vector of paths.

Details

Note that this is different from the Python os.path.basename function, Python always returns a file name or an empty string, i.e. os.path.basename('/foo/bar/') is ''. In R path_basename("/foo/bar/") is "bar".

Value

Character vector of base names.

See Also

path_dirname

Examples

1
path_basename(c("/foo/bar", "/foo/bar/", ".", "foo/bar.c"))

richfitz/pathr documentation built on May 27, 2019, 8:22 a.m.