I would like to install a package directly from a URL for the package source. I want to do this to make it easy for people to test a pre-release version of the package which should not be widely (or permanently) available. This is a similar question but it is different because it only describes how to install from local files not general URLs.
For the sake of this question I will use a link to the boot
package source. Reading ?install.packages
particularly the description of the pkgs
argument suggests:
install.packages(
"http://cran.r-project.org/src/contrib/Archive/boot/boot_1.3-7.tar.gz",
repos = NULL, type = "source"
)
However this fails with:
Warning in install.packages :
installation of package
‘http://cran.r-project.org/src/contrib/Archive/boot/boot_1.3-7.tar.gz’
had non-zero exit status
Suggesting that the URL is being interpreted as the package name, not its location. We can work around this with the following two step procedure:
download.file(
"http://cran.r-project.org/src/contrib/Archive/boot/boot_1.3-7.tar.gz",
"boot"
)
install.packages("boot", repos = NULL, type = "source")
But I would prefer to do this with a single call to install.packages
only; and since install.packages
is capable of downloading files anyway I feel this should be possible.