This is an old revision of the document!
When installing a package using an https URL, you may see this:
> install.packages("mclust", repos="https://cran.cnr.berkeley.edu/") Installing package into ‘/share/apps/ANTsR/20140930-R3.1.1-lib’ (as ‘lib’ is unspecified) Warning: unable to access index for repository https://cran.cnr.berkeley.edu/src/contrib: unsupported URL scheme
This seems to be an R issue relating to SSL/HTTPS connections. Here's a workaround:
options(download.file.method = "wget")
This will tell R to use the wget
command for downloads.
(Thanks to Phil Cook! Updated 4/2017)
Setup in your .bash_profile
file:
export PATH=/share/apps/R/<R version>/:$PATH #note that this may already be defined in .bash_profile, check first
Then on chead
[...]# R > install.packages("devtools", repos="http://cran.cnr.berkeley.edu/") > library(devtools) > install_github("stnava/ITKR") > install_github("stnava/ANTsRCore") > install_github("stnava/ANTsR")
NOTE about R_LIBS environment variable:
As of R 3.2, R should create a default location for local libraries (i.e. that you install on your own). Check using the .libPaths()
command. It should be something like /home/pcook/R/x86_64-pc-linux-gnu-library/3.2
. If you want to install packages somewhere other than the default, you can set R_LIBS.