I have a directory with multiple *.pdf files. I want to find files with two or more keywords/strings in the filename.
In the below example I would like to search for a file which has "trials" and "neurology" in the filename. I used following code but no result.
keyword1 = "trials"
keyword2 = "neurology"
pattern <- c("keyword1", "keyword2")
whichfile <- grep(
x = list.files("~/my_documents"),
pattern = pattern,
value = TRUE)