Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

spell_check_files

Spell Check


Description

Perform a spell check on document files or plain text.

Usage

spell_check_files(path, ignore = character(), lang = "en_US")

spell_check_text(text, ignore = character(), lang = "en_US")

Arguments

path

path to file or to spell check

ignore

character vector with words which will be added to the hunspell::dictionary

lang

set Language field in DESCRIPTION e.g. "en-US" or "en-GB". For supporting other languages, see the hunspell vignette.

text

character vector with plain text

Details

This function parses a file based on the file extension, and checks only text fields while ignoring code chunks and meta data. It works particularly well for markdown, but also latex, html, xml, pdf, and plain text are supported.

For more information about the underlying spelling engine, see the hunspell package.

See Also

Other spelling: spell_check_package(), wordlist

Examples

# Example files
files <- list.files(system.file("examples", package = "knitr"),
  pattern = "\\.(Rnw|Rmd|html)$", full.names = TRUE)
spell_check_files(files)

spelling

Tools for Spell Checking in R

v2.2
MIT + file LICENSE
Authors
Jeroen Ooms [cre, aut] (<https://orcid.org/0000-0002-4035-0289>), Jim Hester [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.