0

I have a code to track objects in the images. This code uses few function from the package clue. So clue is already installed in my system. Now I have created a package using the same code.

My description file has following lines.

Depends: R (>= 3.4.3),

clue

Because clue is already installed, I thought it will not get installed again when I use install("mypackage"). But to my surprise it re-installed the package. I have tried this with other installed packages, too. When I give it as "depends" or "import", it re-installs the packages. I do not want to re-install the packages if they are already on my system. Is there a way to tell R package installer to avoid re-installing packages that exist on the user's system? Some of these packages are quite large and take a lot of time to install. In addition, I have installed some packages with binary source/dependency that required me to give path for several libraries.

Community
  • 1
  • 1
XtrimA
  • 143
  • 11
  • Check Hadley's R packages [book](http://r-pkgs.had.co.nz/description.html) out. – patL May 09 '18 at 10:40
  • You'll need to provide more details on the package (like the full DESCRIPTION file) to get any useful feedback on this. – Thomas May 12 '18 at 11:22

1 Answers1

2

You can just use

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

or if you use devtools::install:

install(..., dependencies = FALSE)
  • Thanks a lot @dash2 ! This solved my issue temporarily. I think when I install my package first time it re-install the dependencies if there are newer version available. Because it doesn't do it every time I re-install the same package. – XtrimA May 14 '18 at 11:53