Clean up text for use as file names. Converts all characters to lowercase, removes punctuation and extra whitespace, replaces spaces between words with underscores, and adds ".pdf" to the end of the title.

clean_titles(data, col = "title")

Arguments

data

data frame

col

text column in the data frame to clean up. "title" by default.

Value

Character vector of cleaned text.

Examples

df <- data.frame(title = c("Paper Title: Subtitle", "O Rly? A Study"), pages = c(20, 40)) df$cleaned <- clean_titles(df)