Skip to content

R CMD check: import rlang pronouns, move sf to Suggests - #114

Merged
NewGraphEnvironment merged 1 commit into
mainfrom
111-r-cmd-check-notes
Oct 1, 2026
Merged

NewGraphEnvironment merged 1 commit into
mainfrom
111-r-cmd-check-notes

Conversation

@NewGraphEnvironment

Copy link
Copy Markdown
Owner

Summary

  • Imports the .data and .env pronouns from rlang (@importFrom rlang .data .env in R/cd-package.R). They were used unqualified in cd_baseline(), cd_compare(), cd_plot_comparison(), cd_plot_timeseries() and cd_summary().
  • Moves sf from Imports to Suggests. No R code calls it: cd_crop() checks inherits(aoi, "sf") and hands the object to terra::vect(), which loads sf itself, and anyone holding an sf object already has sf installed. The examples, README and vignettes still use sf::st_read().
  • The 8 tests that read their AOI with sf::st_read() now skip_if_not_installed("sf"), as the Kendall/zyp tests already do.

Fixes #111

Behaviour change for installers: pak::pak("NewGraphEnvironment/cd") no longer installs sf. The org's only package that depends on cd is wet, which lists it under Suggests.

Related Issues

  • Relates to NewGraphEnvironment/sred-2025-2026#23

Test plan

  • R CMD check --no-manual --ignore-vignettes: Status: OK, 0 NOTEs (was 2). Run with _R_CHECK_FORCE_SUGGESTS_=false, since aws.s3 and ecmwfr are not installed locally.
  • devtools::test(): FAIL 0, PASS 436. Its 6 warnings come from cd_plot_comparison and appear on main too.
  • Installed with sf removed from the library: 8 skips, exactly the sf blocks, 416 passing.
  • Removing the two importFrom lines brings both NOTEs back, so the import is what clears them.
  • /code-check: 3 rounds, all Clean.
    • Round 1: R CMD check plus the terra::vect() path without sf loaded.
    • Round 2: CI workflows still install Suggests, the downstream packages, and identical(ggplot2::.data, rlang::.data).
    • Round 3: a parsed enumeration of every pkg:: and every test that uses sf.

Notes

  • Accepted, not changed: @examples call sf::st_read() without a guard. They fail only under a check that skips Suggests without sf installed, and nothing here checks that way.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GignjoKpZADXywTf6pAMgj

Import the .data and .env pronouns from rlang, which code used unqualified,
and move sf from Imports to Suggests: no R code calls it, and cd_crop() only
checks inherits(aoi, "sf") before terra::vect(), which loads sf itself. Tests
that read their AOI with sf::st_read() now skip without sf.

Fixes #111

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GignjoKpZADXywTf6pAMgj
@NewGraphEnvironment
NewGraphEnvironment merged commit 60daa8d into main Oct 1, 2026
1 check passed
@NewGraphEnvironment
NewGraphEnvironment deleted the 111-r-cmd-check-notes branch October 1, 2026 14:50
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.

R CMD check: two standing NOTEs (unused sf import, .data/.env globals)

1 participant