Gangmax Blog

Install R on Ubuntu

My Ubuntu version is 14.04(Trusty).

From here.

Install R

  1. Get the CRAN mirrors list from here.

  2. Add the following lines to the end of “/etc/apt/sources.list” file:

1
2
3
## Add R.
## CRAN mirrors list: http://cran.r-project.org/mirrors.html
deb http://mirror.bjtu.edu.cn/cran/bin/linux/ubuntu trusty/
  1. Run commands below to install R.
1
2
sudo apt-get update
sudo apt-get install r-base

Done.

Install the “RWeka” package

From here.

  1. Add the following line in your “.bashrc” file:
1
2
# THe content of this line depends on your Java installation path.
export LD_LIBRARY_PATH=/usr/lib/jvm/java-8-oracle/jre/lib/amd64:/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server
  1. Start R

    You can start with “sudo” to install the package in the system level library directory, otherwise it will be install on your home directory.

    Run the command below:

1
install.packages("RWeka")

Comments