I have a list of names (e.g: authors) and a pdf file which includes those names. I need to calculate how many times those authors are mentioned in the pdf file.
Let's say my table of authors is named "author" and the pdf file's name is "pdf" (I converted and stored this pdf file in R already using pdf_text
already)
I've tried the following:
author$count <- 0
author$count <- for (i in author$name) { sum(str_count(pdf, i))}
But it didn't work. When I printed author$count, the results were NULL
. Is there a way to fix this?