Getting Started with and by Dhafer Malouche

R Software:

  1. Download the latest R version (currently is the R 3.6.0 (2019-04-26))
  • For Windows users

https://cran.r-project.org/bin/windows/base/

 

 

  • For Mac users

https://cran.r-project.org/bin/macosx/

 

 

  1. Execute then the .exe (for windows users) or the .pkg (for mac users) file and follow instructions

 

 

  1. Click on the icon on your desktop and check if your R Software is correctly installed. Your R will run as displayed below (this picture is from a mac laptop but very similar to the Windows version)

 

 

RStudio:

  1. RStudio is a free and open-source integrated development environment (IDE) for R. We will only use RStudio for this training.

  2. Before installing Rstudio make sure that your R is correctly installed

  3. Download RStudio from the following link:

 

https://www.rstudio.com/products/rstudio/download/

 

You should download the Free Desktop version

 

 

  1. Choose the latest version corresponding to your OS (Windows or Mac)

 

 

  1. Execute the downloaded file and follow the instructions

  2. Click on the RStudio icon on your desktop. Your RStudio software should be opened as displayed below

 

 

R packages

  • R Packages are collections of R functions, data, and compiled code in a well-defined format. The directory where packages are stored is called the library. R comes with a standard set of packages. Others are available for download and installation. Once installed, they have to be loaded into the session to be used.

 

  • Here’s a web application that can show the popularity of the R packages. Which one are the most downloaded packages

 

 

  • The R packages by topic

 

 

  • In the console window of your RStudio write the following command to get library location where the R packages will be located in your computer

 

 

  • Use also library() command to know the packages installed in your R environment

 

 

  • Use search() to see the list of packages that are currently loaded

 

 

Packages to be installed

  1. Go to install

 

 

  1. Write the name of the package that needed to be installed, make sure that “install dependencies” is checked

 

 

  1. Install now the following packages

    • ggplot2
    • FactoMineR
    • factoextra
    • dplyr
    • foreign
    • dataMaid
    • cem
    • lmtest
    • tabplot