Maiasaura
Maiasaura

Reputation: 32986

Can two R packages be on each others depends list?

Let's say I have 3 packages A, B, and C.

B connects to data repository 1 and has functions specific to that API.

C connects to data repository 2 and has functions specific to that API.

Eventually there will be several more child packages.

Package A will have generic methods and other common functions (e.g. authentication) that apply to data acquired through B and C. The rationale here is that this would be a more streamlined way to keep up with development (e.g. one would have to update a single auth function rather than doing that inside each child package). So it makes sense for A to be on the depends list for B and C

But I would also like users to just install A and have access to all child packages. For this, I want B and C to be on its depends list.

Is this possible? Should I have a better workflow?

Upvotes: 6

Views: 287

Answers (2)

MS Berends
MS Berends

Reputation: 5199

Updated in 2021: this is not possible anymore. R RMD Check will complain and return an error - packages cannot depend on each other.

The gregmisc package mentioned in a previous answer was removed from CRAN (probably because of this reason).

Upvotes: 1

John Colby
John Colby

Reputation: 22588

The gregmisc package is one example like this that installs more focused sub-packages through depends. It doesn't have any functionality, itself, but it certainly could.

http://cran.r-project.org/web/packages/gregmisc

Upvotes: 2

Related Questions