27

I probably have some issues in my connectivity (some sort of blocks, I don't know) and I can't install directly form gitHub

> install_github("assertthat")
Installing github repo(s) assertthat/master from hadley
Installing assertthat.zip from https://github.com/hadley/assertthat/archive/master.zip

I tried with lots of other packages, same result. However, I am able to download master.zip form the browser. Can you tell if it's possible install directly the .zip? thanks.

peterh
  • 11,875
  • 18
  • 85
  • 108
Michele
  • 8,563
  • 6
  • 45
  • 72
  • 3
    The latest dev version of devtools adds an [install_local](https://github.com/hadley/devtools/commit/fb892031953a0f5bde3de48f487030e6e751d232) function that should solve your problem. But, I guess the trouble is installing dev version of devtools in the first place. – Ramnath Jun 28 '13 at 14:54
  • @Ramnath yep.. to have that version of `devtools` you need to get it from `cran` first and then from `gitHub` unfortunately .. – Michele Jun 28 '13 at 14:59
  • Try the `install` function on the unzipped directory. It should work. The `install` function ships with the CRAN version of devtools. – Ramnath Jun 28 '13 at 15:04
  • 1
    @Ramnath `No DESCRIPTION file found in C:\Users\Michele\Downloads\assertthat-master` – Michele Jun 28 '13 at 15:10
  • Strange. I downloaded `asserthat`, unzipped it and ran `install` and it works fine for me. – Ramnath Jun 28 '13 at 15:13
  • @Ramnath I'm just running `install("path")` is there any other parameter to set? – Michele Jun 28 '13 at 15:19
  • Nope. Just that, no parameters to set. You could try switching into your Downloads directory and specifying the relative path. – Ramnath Jun 28 '13 at 15:20
  • @Ramnath just forget my last two comments... `istall` worked just fine, you can put that in an answer if you want. Thanks! – Michele Jun 28 '13 at 15:24

1 Answers1

50

This answer is just a refined version of my comments. Essentially you can install packages using devtools by unzipping a local zipfile downloaded from github, and then running the install function

install("path/to/unzipped_pkg_zip_file")

The latest dev version of devtools contains an install_local utility function that makes it easy to work directly with local zip files.

Ramnath
  • 54,439
  • 16
  • 125
  • 152