I could not find a clear solution, so I would like to ask if there is some tool to count words (excluding R - latex code) in a .Rnw file. Thank you!
1 Answer
Not a direct answer to your question, but knitr::knit_filter()
is a function to exclude R code from an Sweave document, and return a character vector that only contain the prose, of which you can count the words with other tools (such as wc
).