avatar
Kevin Reuning @reuning.bsky.social

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.

aug 18, 2025, 3:22 pm • 4 0

Replies

avatar
Ben Zipperer @benzipperer.org

wait you don't just use unlist(lapply(dir()[which(grepl("Incumbents", dir()))], function(x) ifelse(file.exists(x), x, NA)), use.names = FALSE)

aug 18, 2025, 3:44 pm • 1 0 • view