Installing R (A language and environment for statistical computing and graphics) on Debian GNU/Linux


  • How to tell the Debian/Ubuntu tools where to look for the R packages (a line in /etc/apt/sources.list)
    e.i. deb http://cran.r-project.org/bin/linux/debian lenny-cran/
  • $sudo apt-get update
    
  • If you get following error while running the above command

    GPG error: http://cran.us.r-project.org lenny-cran/ Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 06F90DE5381BA480

    Do the following steps:

    1. you can search for the key at http://keyserver.noreply.org/ and copy it into a plain text file, named, for instance, jranke_cran.asc
    2. Entering “0x381BA480” (NB the prefix “0x” which has to be added to the key “381BA480” as given in CRAN) as the search string, and clicking on “Submit Query” initially gave
    3. pub 1024D/381BA480 2007-02-15 Johannes Ranke (CRAN Debian archive) Fingerprint=6212 B7B7 931C 4BB1 6280 BA13 06F9 0DE5 381B A480″
    4. Clicking on the highlighted “381BA480” in the above then returned

      —–BEGIN PGP PUBLIC KEY BLOCK—–
      Version: SKS 1.1.0
      mQGiBEXUFiURBADkTqPqcRYdLIguhC6fnwTvIxdkoN1UEBuPR6NYW4iJzvRSas/g5bPo5ZxE
      2i5BXiuVfYrSk/YiU+/lc0K6VYNDygbOfpBgGGhtfzYfFRTYNq8QsdD8L8BMYtOu5rYo5BYt
      AwIDFQIDAxYCAQIeAQIXgAAKCRAG+Q3lOBukgM09AKCuapN6slttAFRjs2/mgtaMMwO9sgCf
      ZD2au39Oo8QLXZhZTipN8c7j9mM=
      =BRgm
      —–END PGP PUBLIC KEY BLOCK—–
    5. which duly copied into “ranke_cran.asc” (all of it, including the header abd trailer). Then the recommended command
      $apt-key add jranke_cran.asc
      
  • Install the most recent R version

    $sudo apt-get install r-base-dev r-recommended
    
  • Install Java Development Kit

    $sudo apt-get install sun-java6-jdk
    
  • Enable Java support in R

    $sudo R CMD javareconf
    or 
    $sudo R CMD javareconf JAVA_HOME=/home/shekhar/packages/jdk1.6.0_16
    
  • Install JGR

    sudo R
    > install.packages(‘JGR’)
    > library(JGR)
    > JGR()
    quit R
    
  • Update JGR

    $sudo R
    > library(JGR)
    > JGR(update=TRUE)
    >q() 
    
  • Run once more R as root user to write all script files

    $sudo R
    > library(JGR)
    > JGR()
    >q()
    

Create a free website or blog at WordPress.com.

%d bloggers like this: