Lists every line containing non-ASCII bytes across the package files. CRAN raises a NOTE when source code or documentation contains non-ASCII characters that are not properly escaped. Wraps find_nonascii_files().

audit_ascii(
  pkg = ".",
  scope = c("R", "tests", "vignettes", "man", "DESCRIPTION", "NAMESPACE"),
  ignore_ext = c("png", "jpg", "jpeg", "gif", "rds", "rda", "rdata", "pdf", "ico", "svg"),
  size_limit = 5e+05
)

Arguments

pkg

Path to the package to audit.

scope

Character vector of subdirectories / files to scan.

ignore_ext

Extensions to skip (binary assets, snapshots).

size_limit

Skip files larger than this many bytes.

Value

A data frame with columns file, line, text, n_tokens.

See also

fix_ascii() to apply the rewrite, find_nonascii_files().

Examples

if (FALSE) { # \dontrun{
pkg <- create_example_pkg()
audit_ascii(pkg)
} # }