3

I'm working on a script that creates a package in the current directory (using pdInfoBuilder from BioConductor), and I'd like to install it while the script is running. install.packages() with repo=NULL seems like an obvious choice, but this seems to only except package directories tarballed and gzipped. Is there a way I can override this, since the create.pkg() function doesn't create a *.tar.gz? Currently I am using:

R CMD INSTALL package.name

Thanks, Vince

Vince
  • 7,608
  • 3
  • 41
  • 46

2 Answers2

8

If it's a source file, then use install.packages() and set the repos=NULL:

install.packages(file_name_and_path, repos = NULL, type="source")

See this related question: How do I install an R package from source?

Community
  • 1
  • 1
Shane
  • 98,550
  • 35
  • 224
  • 217
3

If it isn't a .tgz, is it in full directory form? All you have to do is R CMD INSTALL dirname and it'll work. The install.packages() function's only real advantage over a raw R CMD INSTALL is that it will do all the downloading, dependency matching, etc for you.

geoffjentry
  • 4,674
  • 3
  • 31
  • 37