Installing our R development environment on Ubuntu 16.04

[This article was first published on R-Analytics, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.


Installing our R development environment on Ubuntu 16.04

As the first blog entry I thought it would be a good starting point describing how to setup a development environment on my preferred Linux distro – Ubuntu, in this case I am using LTS 16.04.

 Well, after installing our Ubuntu 16.04, let’s install R, in order to do it, please follow the steps in this link:

How to install R on Ubuntu 16.04


Now Download and install rstudio, our favorite IDE:

R studio download link


After this you will have your basic R development environment. The next thing to do is to install R packages, to have a more complete development environment.

Install a series of Ubuntu packages needed before installing R packages:

Open a terminal window and run all the next installation commands:

sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libssl-dev
sudo apt-get install libxml2-dev
sudo apt-get install libmariadb-client-lgpl-dev
sudo apt-get install libpq-dev
sudo apt-get install unixodbc unixodbc-dev
sudo apt-get install libiodbc2-dev
sudo apt-get install libcairo2-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install ggobi
sudo apt-get install xserver-xorg-dev
sudo apt-get install libx11-dev freeglut3 freeglut3-dev
sudo apt-get install libmagick++-dev
sudo apt-get install unixodbc-dev

The other important thing to do before installing R packages is to install Oracle Java and set it as default, because the Java included which is Open JDK will not work with R packages.

Oracle Java installation on UBUNTU 16.04:

For detailed instruction, go to the nest link:

Oracle Java Installation on Ubuntu 16.04

For short, run this instructions:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default

This is a very important step, maybe there are other ways to do it but this one is very easy to do it.
Using the file explorer go to:

/usr/lib/jvm

Copy folder with oracle java, in this case: java-8-oracle

Rename the new folder to: default-java


Run R on a terminal window: sudo R

INSTALL R PACKAGES:

tidyverse -> Opinionated collection of R packages designed for data science.
install.packages( “tidyverse”, dependencies = TRUE )

data.table -> Fast manipulation of large datasets.
install.packages( “data.table”, dependencies = TRUE )

sqldf -> Run SQL instructions on your datasets.
install.packages( “sqldf”, dependencies = TRUE )

stringdist -> Computes string distances, very useful when creating clusters of catalog descriptions.
install.packages( “stringdist”, dependencies = TRUE )

RODBC -> Database access.
install.packages( “RODBC”, dependencies = TRUE )

xts -> Non regular time series package
install.packages( “xts”, dependencies = TRUE )

dygraphs -> Nice graphs for R
install.packages( “dygraphs”, dependencies = TRUE )

openxlsx -> Read, Write and Edit XLSX Files
install.packages( “openxlsx”, dependencies = TRUE )

lubridate -> Dates handling.
install.packages( “lubridate”, dependencies = TRUE )

forecast -> ARIMA and forecast package
install.packages( “forecast”, dependencies = TRUE )

mailR -> Send email from R
install.packages( “mailR”, dependencies = TRUE )

gbm -> gbm ( Gradient Boosting Machine )algorithm for R
install.packages( “gbm”, dependencies = TRUE )

gbm ->  xgboost algorithm for R
install.packages( “xgboost”, dependencies = TRUE )

aTSA -> Time Series Analysis
install.packages( “aTSA”, dependencies = TRUE )

rattle -> Tab-oriented user interface that is similar to Microsoft Office’s ribbon interface. It makes getting started with data mining in R very easy.
install.packages( “rattle”, dependencies = TRUE )

Rcmdr -> R Commander. A platform-independent basic-statistics GUI (graphical user interface) for R, based on the tcltk package.
install.packages( “Rcmdr”, dependencies = TRUE )

itsmr -> Time Series Analysis Using the Innovations Algorithm. Provides functions for modeling and forecasting time series data.
install.packages( “itsmr”, dependencies = TRUE )



Enjoy it!!!.

Carlos Kassab
https://www.linkedin.com/in/carlos-kassab-48b40743/

More information about R:
https://www.r-bloggers.com

To leave a comment for the author, please follow the link and comment on their blog: R-Analytics.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)