I'm trying to trim trailing square brackets, inner quotes and slashes in a list of R strings, preferably using dplyr
.
Sample data:
df <- c("['Mamie Smith']", "[\"Screamin' Jay Hawkins\"]")
Expected result:
"Mamie Smith", "Screamin' Jay Hawkins"
What I have tried:
gsub("[[]]", "", df) # Throws error
df %>%
str_replace("[[]]", "") # Also throws error