14

How to configure and use spell check in Rstudio? In the tools>Global option>spelling I have set the main dictionary language as English(US) and custom dictionary as en_us from "/usr/lib/rstudio/resources/dictionaries/en_US.dic".
Still I do not see any indication (such as red make) on wrong spellings!!

d.putto
  • 7,185
  • 11
  • 39
  • 45

3 Answers3

13

RStudio does not have an as-you-type spell checker; you'll have to invoke spell checking manually. To do this, go to the Edit menu and choose Check Spelling, or press F7.

Note that spell checking is not performed on code files, only on document files (i.e. you won't get spell checking an .R file, but you will in an .Rmd file).

Jonathan
  • 8,497
  • 41
  • 35
2

I recently spotted live, on-the-fly spell checking in OSX v.1.3.118 and later, which can be downloaded from https://dailies.rstudio.com/

enter image description here

enter image description here

Ben
  • 41,615
  • 18
  • 132
  • 227
0

If you want to add custom spell checker and want to be persistent across the Rstudio installations, you can create a hunspell dictionary. Here is what I did:

  1. Create a hunspell dictionary (a nice approach is here)
    1. Create a text document where the first line is the number of words in the dictionary and the rest of the lines are the words in the dictionary. Make sure the last line is empty.

      enter image description here

    2. Save the dictionary with .dic extension.

  2. Add the dictionary to Rstudio from Tools > Global Options... > Spelling > Add.... (More info is here)
  3. Restart Rstudio. Later, when you update the dictionary file, you may need to Remove the dictionary and Add it again, then restart.
HBat
  • 4,873
  • 4
  • 39
  • 56