R: Package Spell Checking

spell_check_package {spelling} | R Documentation

## Package Spell Checking

### Description

Automatically spell-check package description, documentation, and vignettes.

### Usage

    spell_check_package(pkg = ".", vignettes = TRUE, use_wordlist = TRUE)

    spell_check_setup(pkg = ".", vignettes = TRUE, lang = "en-US",
      error = FALSE)

### Arguments

`pkg` | path to package root directory containing the `DESCRIPTION` file
`vignettes` | also check all `rmd` and `rnw` files in the pkg `vignettes` folder
`use_wordlist` | ignore words in the package WORDLIST file
`lang` | set `Language` field in `DESCRIPTION` e.g. `"en-US"` or `"en-GB"`.
`error` | should `CMD check` fail if spelling errors are found? Default only prints results.

### Details

Parses and checks R manual pages, rmd/rnw vignettes, and text fields in the package `DESCRIPTION` file.

The preferred spelling language (typically `en-GB` or `en-US`) should be specified in the `Language` field from your package `DESCRIPTION`. To whitelist custom words use the package WORDLIST file which will be added to the dictionary when spell checking. See update_wordlist to automatically populate and update this file.

The spell_check_setup function adds a unit test to your package which automatically runs a spell check on documentation and vignettes during `R CMD check` if the environment variable `NOT_CRAN` is set to `TRUE`. By default this unit test never fails; it merely prints potential spelling errors to the console.

Hunspell includes dictionaries for `en_US` and `en_GB` by default. Other languages require installation of a custom dictionary, see hunspell for details.

### See Also

Other spelling: `spell_check_files`, `wordlist`

[Package spelling version 1.2 Index]