How to handle dependencies (`Depends:`) of imported packages (`Import:`)

I am trying to use Imports:instead of Depends:in DESCRIPTIONmy package files , but I still feel that I need to understand something else about this; -)

What I learned from this post (by the way: an amazing post !!!) is that all my packages, say mypkg, import (say imported.pkg) through Imports:living in an environment imports:mypkginstead of being bound to a search path. When you try to find foowhich comes with imported.pkg, R scans imports:mypkgbefore moving through the search list. So far so good.

Actual question

If imported.pkg(imported mypkg) depends on a specific other package (indicated in the Depends:package file section DESCRIPTION), do I need to make this package a Depends:dependencies of my package so that R finds the functions of this package? Therefore, it seems to me that at the moment R is complaining.

Data

It seems that just importing such a package is not enough. Take the package roxygen2( CRAN ) as an example . It depends on digestwhen importing a bunch of other packages. I imported it (along with digestthe quality it mypkgalso needs it) and checked the environment imports:mypkgthat lists the function digest: "digest" %in% parent.env(asNamespace("mypkg"))returnsTRUE

roxygenize() , mypkg, R , digest.

+5

All Articles