I was today years old when I learned that instead of writing grep("Incumbents*", dir(), values=TRUE) I could just write dir(pattern="Incumbents*"). Silly Kevin.
I was today years old when I learned that instead of writing grep("Incumbents*", dir(), values=TRUE) I could just write dir(pattern="Incumbents*"). Silly Kevin.
wait you don't just use unlist(lapply(dir()[which(grepl("Incumbents", dir()))], function(x) ifelse(file.exists(x), x, NA)), use.names = FALSE)