Install an R package directly from a URL for the package source

Why not set up the directory in which you store the source package as a repository?

Here is an example (though you'd likely want to substitute type="source" for the type="win.binary" in the code at that link).


install.packages now works with http URLs (not https yet) as of 3.1.1. This works for me:

install.packages("http://www.lepem.ufc.br/jaa/colorout_1.1-0.tar.gz", repos=NULL)

Edit: As of R 3.2.0, https is builtin via libcurl. This should work now:

install.packages("https://github.com/hadley/devtools/archive/v1.7.0.tar.gz",
                 repos=NULL, method="libcurl")

Edit: As of R 3.2.2, https should work with default options assuming libcurl support was compiled in.

Edit 2016-04-20: There may be some issues downloading packages hosted on S3, but method='wget' seems to work for those for now.


See ?install_url in the devtools package.

Tags:

R