10

Is it possible to install a package without installing dependencies?

When run the following command:

install.packages("package",dependencies=FALSE)

if the dependencies are not installed beforehand, isn't it that the installation of the package fails?

My question comes from this post Install a local R package with dependencies from CRAN mirror. Why does it say installing a local package without installing dependencies?

if I set repos=NULL it correctly tries to install the local package file (as documented), but obviously it does not find the dependencies packages.

Thanks!

Community
  • 1
  • 1
Tim
  • 1
  • 141
  • 372
  • 590
  • you might say more about what you're trying to achieve. One possibility (not easy) would be to download the package source and edit out the stuff that depends on the dependencies so that you can use the rest of it ... – Ben Bolker Apr 21 '15 at 15:57
  • @Ben: I am not achieving anything. When I read that post, I wonder why it is possible to install a pacakge without installing its dependencies. – Tim Apr 21 '15 at 16:00
  • OK, then you got your answer ... – Ben Bolker Apr 21 '15 at 16:31

1 Answers1

12

You cannot install and get a package to work without its dependencies. The dependencies= parameter is really an indicator if you would like R to automatically install the dependencies. If set to FALSE, R still stop and warn you so you can decide what you would like to do; if TRUE, R will automatically try to download from your current CRAN repository mirror. With repos=NULL (a local file install) there is nowhere else to look for dependencies so the dependencies= parameter is ignored.

MrFlick
  • 195,160
  • 17
  • 277
  • 295