Cyclic dependencies in packages?

My team is thinking to develop a couple of internal packages for my company: one of these will be a datasets package and another will be a ggplot2-themes package.

I can see where it would be useful for the "themes" package to import the "datasets" package, for examples, etc.

However, I can also see where it could be useful for the "datasets" package to suggest the "themes" package, so it can be used in vignettes to illustrate the datasets.

I guess my question is twofold:

  • is it "ok" for one package to import another, then for the second package to suggest the first?
  • what is the best way to address this situation?

Thanks!

You can definitely have cycles in the suggests pattern of packages (something that also surprised me at first). Roughly the package suggests describe the situation that will be presented to users, not how packages are built.

1 Like

Thanks John - that makes sense!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.