Creating packages with external dependencies

I have a package that I am building with roxygen2

, the problem is that the most important dependent package ( Rgraphviz

) is not in CRAN, but rather bioconductor

.

What is the best and easiest way to get this dependency downloaded when I installed my package? preferably via a file DESCRIPTION

.

+3


source to share


1 answer


In your file, DESCRIPTION

put this line:

Suggests: Rgraphviz

      

and then in your R code use:



if (require(Rgraphviz)) { ... } else stop("Rgraphviz package could not be loaded")

      

The psych package is an example CRAN package that Rgraphviz uses for you to follow.

+4


source







All Articles