Writing code to do word counts for a large corpus

Can you isolate the part you're having trouble with? With reprex, you can see the input and output of the code, without it, someone else has to run what you have to figure out what works, and what doesn't.

This is a really useful guide to scraping with rvest (there's also a thread here on community with some really useful tutorials):