Skip to content

[Linting Rule] Package Data

github-actions[bot] edited this page Nov 1, 2026 · 1 revision

Generated from 'wiki-linter.ts' on 2026-10-25, 09:29:25 UTC (v2.16.6), do not edit directly.

Package Data [overview]

cmd-check 34, 48, 60–64

This rule ports the following steps of R CMD check (see the conformance table for the legend):

# Step Coverage Note
34 LazyData (book) 🟩 the size of the installed LazyData database is not checked
48 for missing documentation entries (book) 🟩 S4 classes and methods are not checked
60 contents of 'data' directory (book) 🟩 data sets are not loaded
61 data for ASCII and uncompressed saves (book) 🟩 no recompression to estimate the savings
62 R/sysdata.rda (book) 🟩 no recompression to estimate the savings
63 serialization versions (book) 🟩 .rds files and xz compressed saves are not read
64 data for non-ASCII characters (book) 🔶 the encodings of saved strings are not read

This rule is a best-effort rule.

Finds problems in data/ and R/sysdata.rda: allowed file types, LazyData, compression, the serialization version R needs, and undocumented data sets.
This linting rule is implemented in src/linter/rules/cmd-check/package-data.ts.

Configuration

Linting rules can be configured by passing a configuration object to the linter query as shown in the example below. The package-data rule accepts the following configuration options:

Examples

A project with the code R/code.R:

f <- function() 1

and the files

DESCRIPTION:

Package: pkg
Version: 1.0
Title: A Package
License: MIT

data/notes.md:

what the data means

The linting query can be used to run this rule on the above example:

[ { "type": "linter",   "rules": [ { "name": "package-data",     "config": {} } ] } ]

Results (prettified and summarized):

Query: linter (1 ms)
   ╰ Package Data (package-data):
       ╰ certain:
           ╰ 'data/notes.md' is not of a type allowed in a 'data' directory at /pkg/data/notes.md:1.1

More examples are the test cases in test/functionality/linter/cmd-check/lint-package-data.test.ts.

Clone this wiki locally