Skip to content

Conversation

@hadley
Copy link
Member

@hadley hadley commented Sep 29, 2025

No description provided.

@jennybc
Copy link
Member

jennybc commented Sep 30, 2025

This definitely contradicts a "rule" I've internalized. Have I truly been confused about this? Or did something change? I think we might need to change some wording in R Packages as well, if this is really the situation.

@hadley
Copy link
Member Author

hadley commented Sep 30, 2025

I don't think anything has changed 😬

@jennybc
Copy link
Member

jennybc commented Sep 30, 2025

FWIW here are the existing base packages which list other base packages in Imports:

# A tibble: 16 × 2 Package imported_pkg <chr> <chr> 1 graphics grDevices 2 grid grDevices 3 grid utils 4 methods stats 5 methods utils 6 parallel compiler 7 parallel tools 8 splines graphics 9 splines stats 10 stats grDevices 11 stats graphics 12 stats utils 13 stats4 graphics 14 stats4 methods 15 stats4 stats 16 tcltk utils 

And in WRE I see:

The Imports field lists packages whose namespaces are imported from (as specified in the NAMESPACE file) but which do not need to be attached. Namespaces accessed by the ::’ and :::’ operators must be listed here, or in Suggests or Enhances (see below). Ideally this field will include all the standard packages that are used ...

So I'm thinking this is still a best practice (?).

@jennybc
Copy link
Member

jennybc commented Sep 30, 2025

While I'm at it, here's a taste of how much tidyverse/r-lib package do this (TL;DR usethis is not alone):

# A tibble: 44 × 4 Package organization base_imports_count base_imports <chr> <chr> <int> <chr> 1 bit64 r-lib 4 graphics, methods, stats, utils 2 remotes r-lib 4 methods, stats, tools, utils 3 crayon r-lib 3 grDevices, methods, utils 4 devtools r-lib 3 stats, tools, utils 5 systemfonts r-lib 3 grid, tools, utils 6 usethis r-lib 3 stats, tools, utils 7 ggplot2 tidyverse 3 grDevices, grid, stats 8 gargle r-lib 2 stats, utils 9 gtable r-lib 2 grid, stats 10 isoband r-lib 2 grid, utils ... 

I know this is a small change, but would require a pretty significant change inside my brain if we're going to say base packages shouldn't appear in Imports.

@hadley
Copy link
Member Author

hadley commented Sep 30, 2025

A better question would be which tidyverse package don't import all the base packages that they use. Which I bet is a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants