Getting Started with R and R studio — An Introduction & Installation Guide.

Lorna Maria A
3 min readDec 5, 2017

--

R is an open source programming language for statistical computing and data analysis.

To begin coding R on your computer ,I recommend that you use R studio. Although other code editors have R extensions ,R studio still remains the home of R and is purely built to support R programming.

This article takes you through a step by step installation of R and R studio.It further explores the features of R studio and helps you create your first R script.

PART ONE

First,we shall download R to our local computer from CRAN (Comprehensive R Archive Network).Download the package that applies to your computer and follow the prompts to install.

CRAN site

For Mac follow the (Mac) OS X download link.Choose the package that applies to your OS X version ,download and install the package (pkg).

OS X has different package files for different versions

For Windows follow the download for Windows link ,click on base and proceed to download and install R for windows.

click on base to proceed
Download R for windows

At this point your computer is now ready to run R but only through the R console. Launch the R console by clicking on the R icon.

On Launching R console

PART TWO

To improve your experience while programming R let us install R studio :R studio is a free and open source integrated development environment for R.Unlike the R console ,R Studio has more features that turn out to be more user friendly .

1.Download R studio here

2.Choose the Package that applies to your system and install.

R studio window

Features of R Studio.

1.Top left : The code Editor-like any other code editor the R code editor has capabilities to auto complete R code,it has inbuilt R keywords,syntax and can recognise errors.

2.Top right :The console- This behaves exactly like the R console,It allows input and displays computation outputs of the R script

3. Bottom Left : Working Environment-This contains the data sets and all variables currently stored in the R working directory.It has a history of all commands and a Git tab that allows you to push your code from R studio to your Github Repository.

4. Bottom Right: Display Tab- This window will display plots that are generated as you visualise your data.The files tab displays files stored in the directory where your R points to . The packages tab displays all packages installed in your R studio. The help tab is available for any help you might need with different R functions.

PART THREE

Lets create our first R script .

  1. Go to New
  2. Select R script

Voila you have created your 1st R script !

--

--

Lorna Maria A

Data Science | Rstats | Life and Travel | Tech Meet-ups