Learn R Programming

textreuse (version 0.1.2)

filenames: Filenames from paths

Description

This function takes a character vector of paths and returns just the file name, by default without the extension. A TextReuseCorpus uses the paths to the files in the corpus as the names of the list. This function is intended to turn those paths into more manageable identifiers.

Usage

filenames(paths, extension = FALSE)

Arguments

See Also

basename

Examples

Run this code
paths <- c("corpus/one.txt", "corpus/two.md", "corpus/three.text")
filenames(paths)
filenames(paths, extension = TRUE)

Run the code above in your browser using DataLab