Reputation: 99
I'm trying to list all files that include a specific word ("students") and file extension (".csv") in their file name. I want to do this through pattern but I must be doing something wrong.
# (1) Create File List
pat=paste("students","*\\.csv$")
csv_files <- list.files (path = "R/win-library/Practice/Schoolprac/",
pattern = pat,
recursive = T,
full.names = T)
The file should include the word "students" and be a .csv file. What could I be doing wrong? Students doesn't need to be right before .csv nor at the beginning, just included. I'm not getting an error, just no results.
Upvotes: 1
Views: 396