Packages on the Comprehensive R Archive Network (CRAN) can obviously directly import other packages that are on CRAN.
Can packages on CRAN also import packages that are not on CRAN? - if not, I guess the options are:
I'm interested because sometimes a contribution makes more sense sitting in a separate package, especially if the contribution is likely to be used in its own right, or in other packages.
I don't think so.
Writing R Extensions specifies that you can include an Additional_repositories
field in the DESCRIPTION file.
However, the CRAN Repository Policy says:
Packages on which a CRAN package depends should be available from a mainstream repository: if any mentioned in ‘Suggests’ or ‘Enhances’ fields are not from such a repository, where to obtain them at a repository should be specified in an ‘Additional_repositories’ field of the DESCRIPTION file (as a comma-separated list of repository URLs) or for other means of access, described in the ‘Description’ field.
I can't think of any solutions beyond the ones you suggest (get the package on CRAN or incorporate the necessary code in your package).