Skip to content
Prev 4365 / 12125 Next

[R-pkg-devel] Problems installing dependences of my package

On Mon, 9 Sep 2019 at 16:58, Andrea Vilar Alvarez
<andreavilaralvarez at hotmail.com> wrote:
Common advice goes the other way around: you should avoid Depends as
much as possible, so that your users' search path doesn't get polluted
with all your dependencies. Rule of thumb: "Depends: pkg1" is like you
are executing "library(pkg1)" in your users' session. You should avoid
that unless it's strictly necessary.

It's important to invest some time to truly understand the difference
between Imports and Depends. Some references:

- https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Package-Dependencies
- http://r-pkgs.had.co.nz/description.html
That's the whole point of declaring dependencies, and that's how
install.packages() works: I install your package and R figures out
what's needed and installs it for me.
As noted above, preferably Imports. But yes, that's correct.
That's another story. R does not support exact versioning. You have
several options to achieve this though [1, 2, 3, 4]. But if you want
to submit your package to CRAN with exact versioning, unfortunately
that's not gonna work; but there are good reasons for that.

[1] https://cran.r-project.org/package=versions
[2] https://cran.r-project.org/package=checkpoint
[3] https://cran.r-project.org/package=rbundler
[4] https://cran.r-project.org/package=packrat

I?aki
Message-ID: <CALEXWq34x3E428pKrt8xWdqtxeTamUFyy4AXDpN6s=HKzVv54Q@mail.gmail.com>
In-Reply-To: <AM6PR04MB600849D420CCD65FC9EC8E99C5B70@AM6PR04MB6008.eurprd04.prod.outlook.com>