Skip to content

R pkgs: consider moving dependencies to Imports instead of Depends #67

@dpprdan

Description

@dpprdan

Boom (and by extension bsts and BoomSpikeSlab) Depends on MASS instead of importing it. Would you consider putting MASS in Imports instead of Depends? (And also the other packages in Depends in bsts and BoomSpikeSlab?)

From R Packages:

The main difference is that where Imports just loads the package, Depends attaches it. There are no other differences.
[...]
Unless there is a good reason otherwise, you should always list packages in Imports not Depends.
That's because a good package is self-contained, and minimises changes to the global environment (including the search path).

Or from WRE:

Field ‘Depends’ should nowadays be used rarely, only for packages which are intended to be put on the search path to make their facilities available to the end user (and not to the package itself)

The main issue is that Depends messes up the search path with packages not explicitly attached by the user. The only upside of Depends is that the package user can call functions from the (implicitly) attached package. But in this case it is not strictly necessary for users of Boom (or bsts) to call functions from MASS.

For a more in-depth treatment see also https://github.com/leeper/Depends

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions