I have an issue with a circular package dependence that prevents 
building/checking, and I seek advice on breaking the circle so the packages can 
pass the build-check tests that are required for CRAN submission.

The package pair I'm working with is slow to build, but my tests suggest the 
issue may be general, and so I will explain it in general terms.

Suppose there are two packages:

1. Foo, a package that defines some data types with S4 classes.

2. Foodata, a package that provides such datasets, for use by Foo.

With this setup, it seems reasonable that Foo "depends" on Foodata, so the data 
can be used in Foo and its documentation.

Since the data within Foodata are S4 classes as defined in Foo, an attempt to 
build-check Foodata will produce an error unless Foo is present.  But Foo 
cannot be built unless Foodata exists, since it depends on it.  Thus neither 
Foo nor Foodata can be built and checked.

One solution would be to wrap the Foo documentation examples (and relevant Foo 
code) in require() blocks, and to make Foo "suggest" Foodata, not "depend” upon 
it.  My question is whether this is the recommended practice, or the common 
practice.

Thanks in advance to anyone who wishes to offer hints.

PS. The problem arose from an attempt to reduce CRAN load by extracting the 
datasets that had been contained within a previous version of Foo.

PPS. my (slow-building) packages are on github and I can supply details if 
needed.

Dan E. Kelley
Professor, Oceanography Department
Dalhousie University, Canada
dan.kel...@dal.ca<mailto:dan.kel...@dal.ca>



        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to