minoo
minoo

Reputation: 575

How can I use dependency packages that are not located on usual repositories while building a new package?

My package depends on another package which is not uploaded in cran, mran or even github and it has a .zip format. When submitting my package on cran it can't find the package and returns errors. How can I use the not uploaded package on public repositories, in a package that want to be submitted on cran?

Upvotes: 1

Views: 84

Answers (1)

John Blischak
John Blischak

Reputation: 1152

Some ideas:

  1. Ask the authors of the original package to submit it to CRAN.
  2. If the package is open source, add it into your package and attribute the original authors (should probably add them as authors on the combined package; also would be a good idea to contact them first)
  3. Create a drat repository for the dependent package and then add this repository in the field Additional_repositories in the DESCRIPTION file

The 3rd option is the only purely technical solution. See the drat documentation, this SO answer from the drat package author, and this thread on R-pkg-devel in which an R package author successfully submits to CRAN following this strategy.

Update: The CRAN package discussed above that used option 3 was wikipediatrend. This line in the DESCRIPTION file sets the Additional_repositories field.

Upvotes: 4

Related Questions