jose.nunez-zuleta at barclays.com
2015-Jan-14 21:37 UTC
[R] Help installing packages with dependencies for R, behind corporate firewall
Hello R-users, I have no practical experience with the R language itself but I've been tasked to install it behind a corporate firewall. Basic installation seems sane but when my user tries to install a custom library like this: install.packages("ggplot2") Installing package into '/home/myuser/rlibs' (as 'lib' is unspecified) Warning: unable to access index for repository http://cran.us.r-project.org/src/contrib Warning message: package 'ggplot2' is not available (for R version 3.1.2) See no progress and eventually nothing gets downloaded into my custom directory. My question is, there is a way to add verbosity to R to see if the network proxy setting are working correctly (I can get files using 'wget' without problems under the same account)? More details about my installation below: 1) I'm behind a firewall with http proxy access. I have no root and made a local installation 2) Contents of my ~/.Renviron: R_LIBS=/home/myuser/rlibs 3) Contents of ~/.Rprofile: r <- getOption("repos") # hard code the US repo for CRAN r["CRAN"] <- "http://cran.us.r-project.org" options(repos = r) rm(r) 4) Http environment variable proxy is set (like export http_proxy=XXXXproxy.XXXX.com. I can see it if I do 'Sys.getenv("http_proxy")' from inside the R prompt) NOTE: I managed to install libraries 'by hand' but for module that have dependencies this doesn't work: cd /home/$USER/rlibs/; wget http://cran.us.r-project.org/src/contrib/timeDate_3011.99.tar.gz; /mylocal/R-3.1.2/bin/R CMD INSTALL -l /localrdir timeDate_3011.99.tar.gz I apologize if this is not the correct list (went through all of them, WIKI and other groups looking for an answer to this issue without much luck). Thanks, --Jose _______________________________________________ This message is for information purposes only, it is not a recommendation, advice, offer or solicitation to buy or sell a product or service nor an official confirmation of any transaction. It is directed at persons who are professionals and is not intended for retail customer use. Intended for recipient only. This message is subject to the terms at: www.barclays.com/emaildisclaimer. For important disclosures, please see: www.barclays.com/salesandtradingdisclaimer regarding market commentary from Barclays Sales and/or Trading, who are active market participants; and in respect of Barclays Research, including disclosures relating to specific issuers, please see http://publicresearch.barclays.com.
Prof Brian Ripley
2015-Jan-14 22:41 UTC
[R] Help installing packages with dependencies for R, behind corporate firewall
On 14/01/2015 21:37, jose.nunez-zuleta at barclays.com wrote:> Hello R-users, > > I have no practical experience with the R language itself but I've been tasked to install it behind a corporate firewall. Basic installation seems sane but when my user tries to install a custom library like this: > > install.packages("ggplot2") > Installing package into '/home/myuser/rlibs' > (as 'lib' is unspecified) > Warning: unable to access index for repository http://cran.us.r-project.org/src/contrib > Warning message: > package 'ggplot2' is not available (for R version 3.1.2) > > See no progress and eventually nothing gets downloaded into my custom directory. My question is, there is a way to add verbosity to R to see if the network proxy setting are working correctly (I can get files using 'wget' without problems under the same account)?Yes. But please follow the posting guide and give the 'at a minimum' information required as this area does depend on the OS. I will guess (you did not say) this is not Windows. Be aware what the posting guide says about doing your own homework. The help for install.packages says See ?download.file? for how to handle proxies and other options to monitor file transfers. and the referenced help file may well answer your question.> More details about my installation below: > > 1) I'm behind a firewall with http proxy access. I have no root and made a local installation > 2) Contents of my ~/.Renviron: > > R_LIBS=/home/myuser/rlibs > > 3) Contents of ~/.Rprofile: > > r <- getOption("repos") # hard code the US repo for CRAN > r["CRAN"] <- "http://cran.us.r-project.org" > options(repos = r) > rm(r) > > 4) Http environment variable proxy is set (like export http_proxy=XXXXproxy.XXXX.com. I can see it if I do 'Sys.getenv("http_proxy")' from inside the R prompt) > > NOTE: I managed to install libraries 'by hand' but for module that have dependencies this doesn't work: > cd /home/$USER/rlibs/; wget http://cran.us.r-project.org/src/contrib/timeDate_3011.99.tar.gz; /mylocal/R-3.1.2/bin/R CMD INSTALL -l /localrdir timeDate_3011.99.tar.gz > > I apologize if this is not the correct list (went through all of them, WIKI and other groups looking for an answer to this issue without much luck). > > Thanks, > > --Jose-- Brian D. Ripley, ripley at stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford 1 South Parks Road, Oxford OX1 3TG, UK