Reputation: 8064
How to conveniently spellcheck R comments with RStudio on R source files?
I am writing a package and I want it to look professional. Thanks to Oxygen, all package's documentation lives in R comments, which by default is excluded from spell checking. So even if spell checking functionality does exist in RStudio, I don't know how to use it.
Upvotes: 11
Views: 1516
Reputation: 11
Well this is moot now that Rstudio has spellcheck for spin documents!
So, I write a lot of my lessons and examples for teaching using spin rather than markdown. It just makes for an easier flow. The problem is that there is no spell-check in a spin document, much like your package documentation example. What I have resorted to is using the terminal then running a command line spellchecker on the document.
I'm on linux so here is my workflow.
example_lesson.R
(typos and all)example_lesson.R
is there> aspell check example_lesson.R
Once I'm done with aspell, I go back to the editor window in Rstudio and it updates what I am working on with the spell-checked version. I spin it and I am done.
I've only tested with small examples, but it has worked thus far. Your mileage may vary. Hope that helps.
Upvotes: 0
Reputation: 1651
RStudio 1.3 will include this feature; and it is possible to already try it out.
Upvotes: 2
Reputation: 610
The spelling
package is great for this: https://github.com/ropensci/spelling.
devtools::install_github("ropensci/spelling")
spelling::spell_check_package() # path to package Project
Upvotes: 4