d.putto
d.putto

Reputation: 7575

spell check in Rstudio

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!!

Upvotes: 14

Views: 4975

Answers (3)

HBat
HBat

Reputation: 5682

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.

Upvotes: 0

Ben
Ben

Reputation: 42283

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

Upvotes: 2

Jonathan
Jonathan

Reputation: 8812

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).

Upvotes: 13

Related Questions