Rate This Document
Findability
Accuracy
Completeness
Readability

Installing the R Language

Install the R language on Linux and configure environment variables for the system to recognize R commands, ensuring smooth operation and functionality.

  1. Download the R language installation package.
    1
    wget http://cran.rstudio.com/src/base/R-3/R-3.1.1.tar.gz
    
  2. Decompress the package.
    1
    tar -zxf R-3.1.1.tar.gz
    
  3. Install dependencies.
    1
    yum -y install bzip2-devel zlib-devel xz-devel pcre-devel libcurl-devel openssl-devel libXt-devel.aarch64 readline-devel.aarch64
    
  4. Go to the directory generated after the decompression.
    1
    cd R-3.1.1
    
  5. Perform compilation.
    1
    2
    ./configure --enable-R-shlib --enable-R-static-lib --with-libpng --with-jpeglib --prefix=/opt/tools/installed/R-3.1.1
    make all -j10 && make install
    
  6. Configure the R language environment variables.
    1. Open the /etc/profile file.
      vi /etc/profile
    2. Press i to enter the insert mode and add the following content to the file:
      export R_HOME=/opt/tools/installed/R-3.1.1
      export PATH=$R_HOME/bin:$PATH
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  7. Make the environment variables take effect.
    1
    source /etc/profile