Skip to content
Skills Library
Programming · Review & audit

r-package-check-notes

/r-package-check-notes

Drive R CMD check to zero errors, warnings and notes in a package that sets enforce-note-blocklist — the eight blocked NOTE patterns, what causes each, and how to fix it. Use when R CMD check fails, when a CI check job reports a NOTE, or when cleaning up a package before release or CRAN submission.

Licence
Apache-2.0
Last repository change
26.09.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 26.09.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Drive R CMD check to zero errors, warnings and notes in a package that sets enforce-note-blocklist — the eight blocked NOTE patterns, what causes each, and how to fix it. Use when R CMD check fails, when a CI check job reports a NOTE, or when cleaning up a package before release or CRAN submission.

Original author description

Drive R CMD check to zero errors, warnings and notes in a package that sets enforce-note-blocklist — the eight blocked NOTE patterns, what causes each, and how to fix it. Use when R CMD check fails, when a CI check job reports a NOTE, or when cleaning up a package before release or CRAN submission.

How it works

  1. When to use
  2. Run it
  3. Why NOTEs matter here
  4. The eight patterns: cause and fix
  5. Triage order
  6. Guardrails
  7. Source
Original SKILL.md headings · 157 lines, 776 words
SKILL.md preview
---
name: r-package-check-notes
description: 'Drive R CMD check to zero errors, warnings and notes in a package that sets enforce-note-blocklist — the eight blocked NOTE patterns, what causes each, and how to fix it. Use when R CMD check fails, when a CI check job reports a NOTE, or when cleaning up a package before release or CRAN submission.'
---

# Driving R CMD Check to Zero

## When to use

- `devtools::check()` (or a CI `r-cmd` job) reports ERROR / WARNING / NOTE
- Preparing a release, or before submitting to CRAN
- "Make the check clean", "why does check complain about ..."

## Run it

```r
devtools::check()                 # standard
NOT_CRAN=true devtools::check()   # runs tests skipped on CRAN (matches the non-CRAN CI job)
```

Read results from the bottom up — `R CMD check` prints a summary of all findings at the end.

Severity ladder: **ERROR** (blocks install) → **WARNING** (blocks CRAN) → **NOTE** (cosmetic,
but see below).

## Why NOTEs matter here

With `enforce-note-blocklist: true`, a CI job fails if the check output matches any pattern
in `note-blocklist`. These NOTEs would normally be advisory; here they are **hard failures**:

```
checking dependencies in R code .* NOTE
checking R code for possible problems .* NOTE
checking examples .* NOTE
checking Rd line widths .* NOTE
checking S3 generic/method consistency .* NOTE
checking Rd .usage sections .* NOTE
checking for unstated dependencies in vignettes .* NOTE
checking top-level files .* NOTE
```

Each is a regex of the form `checking <thing> .* NOTE`, so it matches whatever text R CMD
check emits for that step.

## The eight patterns: cause and fix

### 1. `checking dependencies in R code ... NOTE`

Two common messages:

- *"'::' or ':::' import not declared from: 'x'"* — you call `x::fun()` but `x` is not in
  `Imports`. Fix: `usethis::use_package("x")`.
- *"All declared Imports should be used"* — an `Imports` entry nothing calls. Fix:
  `usethis::use_package("x", type = "Suggests")` to demote it, or delete it. Prefer
  `pkg::fun()` over `@importFrom` so this stays auditable.

### 2. `checking R code for possible problems ... NOTE`

Usually *"no visible binding for global variable 'x'"* from tidyverse non-standard
evaluation (`dplyr::filter(median)`, ggplot2 `aes(x)`).

Fix options, best first:

```r
# preferred: import the symbol
#' @importFrom rlang .data
dplyr::filter(.data$median > 1)

# or declare it once
utils::globalVariables(c("median", "AVAL"))
```

Also check for *"undefined global functions or variables"* — a genuine typo.

### 3. `checking examples ... NOTE`

Examples are too slow, or error. Fixes:

- Wrap genuinely slow code in `\donttest{}` (still run by CI, skipped by CRAN on a timer).
- Wrap code needing credentials or network in `\dontrun{}`.
- Otherwise make the example smaller — reduce iterations, use a pre-built dataset from
  `data/` or `inst/extdata`.

```r
#' @examples
#' \donttest{
#' fit_model(large_data)
#' }
```

### 4. `checking Rd line widths ... NOTE`

An `.Rd` file has a line over 90 characters. The `.Rd` files are generated from roxygen
comments, so **edit the roxygen comment, not the `.Rd`**, then re-run
`devtools::document()`. Re-wrap prose so no rendered line exceeds ~90 characters; long
`@param` descriptions and URLs are the usual culprits.

### 5. `checking S3 generic/method consistency ... NOTE`

Your method's signature does not match its generic. Every argument of the generic must
appear, including `...`, in the same order.

```r
# wrong
print.myclass <- function(x) { ... }
# right
print.myclass <- function(x, ...) { ... }
```

### 6. `checking Rd .usage sections ... NOTE`

The `\usage{}` in docs disagrees with the function's actual formals — stale `man/` after
you changed a signature. Fix: `devtools::document()` and re-check. If it persists, the
roxygen comment and the function definition genuinely disagree.

### 7. `checking for unstated dependencies in vignettes ... NOTE`

A vignette uses a package that is declared nowhere. Fix: add it to `Suggests`
(`usethis::use_package("x", type = "Suggests")`). The vignette builder (`knitr`) and
everything the vignette loads must be declared.

### 8. `checking top-level files ... NOTE`

Non-standard files or directories in the package root. Fix: add them to `.Rbuildignore` if
they are legitimate project files that should not ship.

```
^renv$
^renv\.lock$
^\.github$
^\.lintr$
^_pkgdown\.yml$
^docs$
^programs$
.*_KEY
```

## Triage order

1. Fix ERRORs — nothing else is trustworthy until the package installs.
2. Fix WARNINGs — these block CRAN.
3. Fix the eight blocked NOTEs — these block *this* CI even though CRAN tolerates them.
4. Consider remaining NOTEs; they are advisory, but a clean check is the goal.
5. Re-run `NOT_CRAN=true devtools::check()` — it runs more tests and can surface problems
   the default run hides.

## Guardrails

- `man/` and `NAMESPACE` are **generated**. Edit roxygen comments, then
  `devtools::document()`. Never hand-edit either file.
- The `roxygen` CI job runs with `auto-update: true`, so CI may commit regenerated docs for
  you. Run `devtools::document()` locally first so you own the change instead.
- Do not silence a check by weakening the test or deleting a `@examples` block. Fix the
  underlying cause.

## Source

Distilled from the `note-blocklist` and `enforce-note-blocklist` settings in
`autoslider.core/.github/workflows/check.yaml`, which uses
[insightsengineering/r.pkg.template](https://github.com/insightsengineering/r.pkg.template).

Versions

The database has no other skills named r-package-check-notes.

Database snapshot: 13.11.2026 · package version 63edb4e8f4a4 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100r-package-check
    运行完整的 R 包发布检查:重新生成文档、运行测试套件和 R CMD check --as-cran,并在发布或投稿前依据 CRAN 政策逐条处理 ERROR / WARNING / NOTE。用户说 "check my R package"、"R CMD check"、"is this package CRAN-ready"、"run devtools::check"、"prepare for CRAN submission"、"检查 R 包"、"准备提交 CRAN" 时,或指向含 DESCRIPTION 文件的目录时使用。检查报告和 CRAN…
  • 100r-package-check
    Run the full R package release gate — regenerate docs, run the test suite, run R CMD check --as-cran, and triage every ERROR / WARNING / NOTE against CRAN policy before a release or submission. Use when the user says "check my R package", "R CMD check", "is this package…
  • 100r-cran-status
    Look up an R package's live status on cran.r-project.org - submission/review state (queue, human review, waiting, archived, past version's fate) or R CMD check results (OK/NOTE/WARN/ERROR per platform). Use for "what's the CRAN status of X", "did X get accepted/rejected", "is X…
  • 100cran-safe-release
    Defensive engineering checklist for building and releasing R packages that stay on CRAN — especially packages that access internet resources (databases, APIs, hosted datasets), which historically get archived when flaky network fails R CMD check. Use when preparing a CRAN…
  • 100release-notes
    Write the release-notes line a branch owes to the changelog of the program it changes -- cmd/hive/releasenotes/changelog/unreleased/ for the hive CLI, cmd/desktop/releasenotes/changelog/unreleased/ for Hive Desktop, cmd/drive-server/releasenotes/changelog/unreleased/ for Hive…
  • 100r-cran-extrachecks
    Prepare R packages for CRAN submission by checking for common ad-hoc requirements not caught by devtools::check(). Use when: (1) Preparing a package for first CRAN release, (2) Preparing a package update for CRAN resubmission, (3) Reviewing a package to ensure CRAN compliance,…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.