How can I use spell check in Rmarkdown?
Asked Answered
E

2

45

I want to write a report with Rmarkdown. However, I am a little worried about my spelling. I hope there is a package installed in my Rstudio which can automatically help me spell check.

So, is there such a package or is there a way to solve this problem?

Evora answered 19/4, 2016 at 19:46 Comment(0)
F
75

Here are three ways to access spell checking in an rMarkdown document in rstudio:

  1. A spell check button to the right of the save button (with "ABC" and a check mark).
  2. Edit > Check Spelling...
  3. The F7 key

A keyboard alternative to option 2 is alt + e + s. That is, while holding down the alt key, type e followed by s.

Frightful answered 19/4, 2016 at 19:57 Comment(6)
As of Version 1.0.143 on Windows I don't see the "ABC" and check mark or Edit > Check Spelling... F7 is the right shortcut but isn't doing anything for me right now.Wonderful
Hey @StevenMortimer I just tried with 1.0.143 at home, and the abc checkmark etc are still there. My guess is that you don't aren't using the proper file type. If you go to file > new File > Rmarkdown or file > new File > Sweave or Rpresentation, (depending on what document you are trying to create) you should see the checkmark. The spellcheck is not activated for .R script files.Frightful
@Imo You are right that those spell checking options only appear if you are looking at an RMarkdown document.Wonderful
It would be cool to spell check in all file types, not just rMarkdown.Vanquish
Is there a possibility to only check spelling outside of code blocks? In an Rmd file I mostly type explanatory text around code and output, and only the explanatory text needs spell checking. But now, if you simply run the spell check, it also checks all of the code.Volk
As of Rstudio 1.2.5033, the answer as fas as I can tell is "no." (Global Options > Spellling does not include this as an option) Version 1.3 was recently released. I did not see anything about improved spell checking in their release notes. This would be a nice improvement. You could request such a feature on their Github page.Frightful
C
1

There is Real Time Spellchecking since RStudio 1.3:
https://blog.rstudio.com/2020/02/11/rstudio-1-3-preview-real-time-spellchecking/

Chlorosis answered 14/6, 2020 at 19:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.