Skip to content

Bring the installed size under CRAN's 5 MB limit: xz lazy data, ragg vignette figures (#219) - #253

Merged
feralaes merged 1 commit into
mainfrom
installed-size
Nov 14, 2026
Merged

feralaes merged 1 commit into
mainfrom
installed-size

Conversation

@feralaes

Copy link
Copy Markdown
Collaborator

Part of #219.

Problem

R CMD check reported an installed size of 6.0 MB: data 3.5 MB and docs (built vignettes) 2.0 MB. CRAN flags packages over 5 MB. The R 4.1.3 run in #249 showed it as a NOTE, and current R reports it as INFO.

The data is large because the same PSA samples are stored three times once installed: cancer_psa_data, plus the superseded example_psa and example_psa_obj, which are rebuilt from it at install time. #248 stopped storing them three times in the tarball, but the installed lazy-load database still holds three copies. The two superseded datasets can only go in 2.0.

Changes

  1. LazyDataCompression: xz in DESCRIPTION. Installed data drops from 3.5 to 2.8 MB. The loaded objects are identical() to before.
  2. Vignette figures use ragg_png, which writes PNGs about 22% smaller at the same 672 × 480 resolution. Built docs drop from 2.0 to 1.6 MB.
    • ragg is added to Suggests.
    • Each setup chunk falls back to the default png device if ragg isn't installed.
    • Lowering the dpi would save more, but the figures would be visibly blurrier, so I didn't.
Before After
Installed size 6.0 MB (NOTE/INFO) 4.8 MB (checking installed package size ... OK)
Installed data 3.5 MB 2.8 MB
Installed docs 2.0 MB 1.6 MB
Tarball 2.83 MB 2.51 MB

@evaenns, this adds one line to the setup chunk of each vignette (dev = ...), so you'll see it when you merge main into your #216 work. It also leaves only about 0.2 MB of margin. If the new "Get started" vignette adds several figures, please keep an eye on its size. The two PSA scatterplots in psa_analysis are the largest images, at about 140 KB each.

Verification

  • devtools::test(): 345 passed, 0 failed. lintr: 0 lints.
  • Every vignette and Rd example output is identical to main.
  • R CMD check --as-cran: only the development-version NOTE, and the installed size is OK.

…s in vignettes (#219)

R CMD check reported an installed size of 6.0 MB (data 3.5 MB, doc 2.0 MB). CRAN flags
packages over 5 MB.

- LazyDataCompression: xz. The same PSA samples are stored three times in the lazy-load
  database (cancer_psa_data, and the superseded example_psa and example_psa_obj rebuilt from
  it at install), so the compression matters: data 3.5 -> 2.8 MB. Loaded objects identical.
- Vignette figures use ragg_png (ragg in Suggests; falls back to png without it): same
  resolution, about 22% smaller PNGs. doc 2.0 -> 1.6 MB.

Installed size 6.0 -> 4.8 MB ("checking installed package size ... OK"); tarball 2.83 -> 2.51 MB.
@feralaes
feralaes merged commit 5dd334c into main Nov 14, 2026
13 checks passed
@feralaes
feralaes deleted the installed-size branch November 14, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant