0

I got cluster account from my college, and got installed R 2.13.0 in linux cluster(redhat 2.6.18-128.el5) but I'm not able to install r packages. I tried the following codes

  1. install.packages('plyr') and I selected the CRAN mirror as 1. then I got the following msg.

Warning: unable to access index for repository http://cran.ms.unimelb.edu.au/src/contrib Warning messages: 1: In open.connection(con, "r") : unable to resolve 'cran.r-project.org' 2: In getDependencies(pkgs, dependencies, available, lib) : package ‘plyr’ is not available (for R version 2.13.0)

  1. now I made a local lib and tried

    mkdir ~/R_libs
    install.packages("lattice",repos="http://cran.r-project.org", lib="~/R_libs/")
    

then again warning

Warning: unable to access index for repository http://cran.r-project.org/src/contrib Warning message: In getDependencies(pkgs, dependencies, available, lib) : package ‘lattice’ is not available (for R version 2.13.0)

I downloaded packages, and uploaded into the cluster. is it possible to install from that??

I don't have any sudoers rights(Administrator privileges). cluster is having 32 nodes.

Edit: I uploaded car_2.1-0.zip to the cluster and tried the bellow code.

R CMD INSTALL car_2.1-0.zip -l /R_libs

but I got the response as shown below

Error in rawToChar(block[seq_len(ns)]) : embedded nul in string: 'PK\003\004\n\0\0\0\0\0\xef3ZG\0\0\0\0\0\0\0\0\0\0\0\0\004\0\0\0car/PK\003\004\024\0\002\0\b\0\xe03ZGn\xaa\xf3\x90Q\001\0\0\xa2\002\0\0\f\0\0\0car/CITATION\x9dR\xc1j\0021\020=W\xf0\037\x86=\xed\x82\xec\xd6\036\x85\036\xb6b)E'

Is there any way to overcome this?? Thanks

bibinwilson
  • 348
  • 2
  • 6
  • 20
  • Do you have internet access via the cluster? – N311V Nov 12 '15 at 07:47
  • yes. I think so!!(I'm accessing it from my laptop). how can I conform it?? – bibinwilson Nov 12 '15 at 07:48
  • You can access the cluster via ssh (Putty) but still not be allowed access to the internet proper. Also, that zip file is probably the windows version not linux. Try entering `wget https://cran.r-project.org/src/contrib/car_2.1-0.tar.gz` from the command line and if you've got internet access it'll download the right file. Two birds with one stone. – N311V Nov 12 '15 at 09:57
  • You are right. I don't have internet access. It's showing "failed:Temporary failure in name resolution." as message. – bibinwilson Nov 12 '15 at 10:32
  • thank you so much "N311V", I downloaded .tar.gz files and and am able to install packages now. but not able to install the current versions, why because most of the packages are depends on R>3.0.0. I'm searching and downloading the required r packages according to my R version now. – bibinwilson Nov 12 '15 at 10:35
  • I suggest that you download a recent version of R and build it from source under your home directory. That would be simpler than tracking down old versions of all of the dependencies just to build plyr, not to mention other packages you may want to install. – Steve Weston Nov 13 '15 at 13:29
  • @SteveWeston.. How to do that?? I don't have Administrator privileges. Can you give some link for its procedure, or can you plz explain it?? I'm new to linux cluster. – bibinwilson Nov 13 '15 at 17:18
  • Just follow the build instructions from section 2.1 of the "R Installation and Administration" manual, but don't actually install it as described in section 2.4 (in other words, just execute "./configure; make"). You can then execute R straight out of the "bin" directory that is created. Since you're not installing it into a system directory you don't need administrator privileges. Afterwards, you can even install packages into that build directory because you own it. – Steve Weston Nov 13 '15 at 19:12
  • @SteveWeston.. Thank you so much.... I downloaded and installed. but while I type R in the command line, even in the R-3.2.2 bin directory, it's loading the old version(R-2.13.0). How can I load the latest version that I installed now?? Thank you – bibinwilson Nov 15 '15 at 08:30
  • problem solved http://stackoverflow.com/questions/33720790/how-to-access-new-version-of-r-in-linux – bibinwilson Nov 15 '15 at 18:11

2 Answers2

2

Thank you so much for providing the details for my question as comment. Let me conclude all those information here.

Instead of begging to your system admin, it's better to follow the following procedure

Step 1: download latest version of R from the following link : https://cran.r-project.org/sources.html(i downloaded R-3.2.2)

Step 2: upload it into your cluster(I'm using WinSCP in windows 8.1)

Step 3: unpack it using the following command tar -xf R-x.y.z.tar.gz

in my case its tar -xf R-3.2.2.tar.gz

Step 4: go to that directory using the code cd R-3.2.2

Step 5: type ./configure or ./configure --enable-R-shlib && make

Step 6: after the completion of config, type make

Step 7: Then check the built system works correctly by make check

Enjoy!!!

bibinwilson
  • 348
  • 2
  • 6
  • 20
0
module load R

(say this is the R on the cluster, so now it is on your path and you can enter it by typing R)

export R_LIBS_USER=$HOME/apps/R:$R_LIBS_USER

(you are still on the Linux commandline, not in R yet)

R

(now you enter R)

install.packages("packagename")

Well done, it will install the package to HOME/apps/R

library(packagename)

(Try it and see it worked)

FatihSarigol
  • 647
  • 7
  • 14