spell check in Rstudio
Asked Answered
T

3

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

Themistocles answered 27/7, 2015 at 12:38 Comment(0)
J
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).

Jackscrew answered 27/7, 2015 at 20:28 Comment(5)
Thanks. It is disappointing that spell-check can't be done on .R file. Other editor such as "Eclipse" have this feature. I hope RStudio will include it.Themistocles
Indeed. Spellcheck on comments in R files would be a nice addition.Cassandry
as well as "as-you-type" spell checker, would be a nice feature to havePontone
similar/maybe duplicate post:#36728561Highspeed
This response is outdated, R Studio now has spell check in real time.Veranda
P
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

Pargeting answered 27/5, 2019 at 5:17 Comment(1)
Is this still available?Calcifuge
M
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.
Mitzvah answered 6/7, 2020 at 14:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.