Skip to contents

Check for missing packages in library(), require(), loadNamespace(), and requireNamespace() calls.

Usage

missing_package_linter()

See also

linters for a complete list of linters available in lintr.

Examples

# will produce lints
lint(
  text = "library(xyzxyz)",
  linters = missing_package_linter()
)
#> ::warning file=<text>,line=1,col=1::file=<text>,line=1,col=1,[missing_package_linter] Package 'xyzxyz' is not installed.

# okay
lint(
  text = "library(stats)",
  linters = missing_package_linter()
)