Learn R Programming

soundcorrs (version 0.4.0)

path2name: Extract file name from path string.

Description

Convert a path to file to just its name, without the path or the extension.

Usage

path2name(...)

Arguments

x

[character] Path to a file.

Value

[character] The name of the file.

Details

A combination of basename to strip the path, and tools::file_path_sans_ext to strip the extension.

Examples

Run this code
# NOT RUN {
sapply (list.files("~",full.names=TRUE), soundcorrs:::path2name)
# }

Run the code above in your browser using DataLab