This lesson is in the early stages of development (Alpha version)

Introduction to R and R studio

Overview

Time: min
Objectives
  • Understand the basics of R and R studio

  • learn about the Rstudio Interface

R

R is a specialized language most commonly used for statistical computing, data analysis, and implementing graphics. It is open-source and free. R Language is widely used by statisticians and data miners for developing statistical software and data analysis. It helps to perform data wrangling, analyzing, and visualizing data easily.

Why use R

Based on the 2021 survey conducted by Kaggle, R was the third most used programming language by data professionals

Programming language use chart

Image Source: Business Broadway, 2021

Understanding R Studio and Console

RStudio is the integrated development environment (IDE) for the basic R software. It is available in two versions:

RStudio Interface

Script Area: - Write codes (or) scripts and run them separately. Also, create a document outline (located on the top right of the script area) in this section that shows all the cod headers in one space.

Console: - Write and run the code together directly here. It also displays the history of any command or an error message in case of a code error.

Environment – List of objects and variables created and present in the current session and also shows the current project file name at the top right of the pane.

Graphics: - Displays the plots, packages, and has an important tab of files. The files option helps us navigate through the different folders of the current project and makes organizing and sorting things a lot better.

The preferences tab in the toolbar helps customize the margins, displays, and font sizes in the r studio.

Help and Cheatsheets in RStudio

help(function_name) – Provides detailed description of function in help window (bottom right) E.g., Run the command help(sort) in the console.

Help Rstudio

You will now get a complete description of the “sort” function in the help window Points to note:

Cheatsheet – In the wild and woolly world of R there are many packages and to summarize this package functions the cheat sheets come in handy. These cheat sheets are invaluable as learning tools. RStudio has created a large number of cheat sheets, including the one-page R Markdown cheat sheet, which is freely available here

Cheatsheet

Key Points