Difference between revisions of "R/C2/Overview-of-R-and-RStudio/English"
Sudhakarst (Talk | contribs) (Created page with "'''Title of the script''': Overview of R and RStudio '''Author''': Madhuri Ganapathi and Sudhakar Kumar (IIT Bombay) '''Keywords''': R, RStudio, command-line interface, pie...") |
|||
(10 intermediate revisions by 3 users not shown) | |||
Line 6: | Line 6: | ||
{| border =1 | {| border =1 | ||
− | |'''Visual | + | |'''Visual Cue''' |
− | |''' | + | |'''Narration''' |
|- | |- | ||
|| Show slide | || Show slide | ||
Opening Slide | Opening Slide | ||
− | || Welcome to this spoken tutorial on '''Overview of R and RStudio | + | || Welcome to this spoken tutorial on '''Overview of R and RStudio'''. |
|- | |- | ||
|| Show slide | || Show slide | ||
Learning Objectives | Learning Objectives | ||
− | |||
− | |||
|| In this tutorial, we will learn: | || In this tutorial, we will learn: | ||
* About '''R''' programming language | * About '''R''' programming language | ||
* Applications of '''R''' | * Applications of '''R''' | ||
− | * About '''RStudio''' | + | * About '''RStudio''' and |
* Topics covered in this series | * Topics covered in this series | ||
− | |||
|- | |- | ||
Line 31: | Line 28: | ||
System Specifications | System Specifications | ||
− | || This tutorial is recorded on | + | || This tutorial is recorded on, |
* '''Ubuntu Linux '''OS version '''18.04''' | * '''Ubuntu Linux '''OS version '''18.04''' | ||
* '''R''' version '''3.4.4''' | * '''R''' version '''3.4.4''' | ||
* '''RStudio''' version '''1.2.5033''' | * '''RStudio''' version '''1.2.5033''' | ||
− | |||
It is recommended to install '''R''' version '''3.2.0''' or higher. | It is recommended to install '''R''' version '''3.2.0''' or higher. | ||
Line 48: | Line 44: | ||
About R | About R | ||
− | + | || Let us first see what ''' R '''is. | |
− | + | ||
− | || Let us first see what''' R '''is. | + | |
* '''R''' is a programming language developed by '''Ross Ihaka''' and '''Robert Gentleman''' in 1993. | * '''R''' is a programming language developed by '''Ross Ihaka''' and '''Robert Gentleman''' in 1993. | ||
* '''R''' is used in statistics, data analysis, and machine learning algorithms. | * '''R''' is used in statistics, data analysis, and machine learning algorithms. | ||
* It is a free/libre open source software. | * It is a free/libre open source software. | ||
− | |||
|- | |- | ||
|| Show slide | || Show slide | ||
− | |||
Features of R | Features of R | ||
− | || Some of its salient features are: * '''R''' provides support for both procedural programming and object-oriented programming. | + | || Some of its salient features are: |
+ | * '''R''' provides support for both procedural programming and object-oriented programming. | ||
* '''R '''can be integrated with other programming languages like '''C, C++, Python, Java''', etc. | * '''R '''can be integrated with other programming languages like '''C, C++, Python, Java''', etc. | ||
− | |||
|- | |- | ||
Line 69: | Line 61: | ||
Features of R | Features of R | ||
− | || * '''R '''is capable of effective data handling and storage. | + | || |
+ | * '''R '''is capable of effective data handling and storage. | ||
* '''R '''has more than 10,000 packages in its repository. | * '''R '''has more than 10,000 packages in its repository. | ||
* '''R''' is cross-platform compatible. | * '''R''' is cross-platform compatible. | ||
− | |||
− | |||
|- | |- | ||
|| Show slide | || Show slide | ||
Features of R | Features of R | ||
− | || * '''R '''facilitates complex operations with '''vectors, arrays''', and '''data frames'''. | + | || |
− | * '''R '''has community support of avid developers. | + | * '''R '''facilitates complex operations with '''vectors, arrays''', and '''data frames'''. |
− | + | * '''R '''has a community support of avid developers. | |
|- | |- | ||
|| Show Slide | || Show Slide | ||
− | |||
− | |||
Applications of R | Applications of R | ||
− | || '''R '''is extensively used in-* Fraud detection especially in the finance and banking sectors. | + | || '''R '''is extensively used in- |
+ | * Fraud detection especially in the finance and banking sectors. | ||
* Social media analysis to discover potential customers in online advertising. | * Social media analysis to discover potential customers in online advertising. | ||
− | |||
|- | |- | ||
|| Show Slide | || Show Slide | ||
− | |||
Applications of R | Applications of R | ||
− | || * Healthcare to perform pre-clinical trials and analyze the drug-safety data. | + | || |
+ | * Healthcare to perform pre-clinical trials and analyze the drug-safety data. | ||
* E-Commerce companies to analyze the purchases made by customers. | * E-Commerce companies to analyze the purchases made by customers. | ||
− | |||
|- | |- | ||
Line 107: | Line 95: | ||
Names of the companies that use '''R''' | Names of the companies that use '''R''' | ||
− | || ANZ Bank:* '''ANZ Bank''', the fourth largest bank in '''Australia''', uses '''R''' for '''credit risk analysis. ''' | + | || ANZ Bank: |
+ | * '''ANZ Bank''', the fourth largest bank in '''Australia''', uses '''R''' for '''credit risk analysis. ''' | ||
* It also uses '''R''' to fit models for mortgage loss. | * It also uses '''R''' to fit models for mortgage loss. | ||
− | |||
|- | |- | ||
Line 115: | Line 103: | ||
Names of the companies that use '''R''' | Names of the companies that use '''R''' | ||
− | || Facebook:* '''Facebook''' uses '''R''' for '''exploratory data analysis, experimental analysis,''' etc. | + | || Facebook: |
+ | * '''Facebook''' uses '''R''' for '''exploratory data analysis, experimental analysis,''' etc. | ||
* It also uses '''R''' for analyzing user behavior like status updates and profile pictures. | * It also uses '''R''' for analyzing user behavior like status updates and profile pictures. | ||
− | |||
|- | |- | ||
|| Names of the companies that use R | || Names of the companies that use R | ||
− | || Google:* '''Google''' uses '''R''' to calculate return on investment on advertising campaigns. | + | || Google: |
+ | * '''Google''' uses '''R''' to calculate return on investment on advertising campaigns. | ||
* It also uses '''R''' to improve the efficiency of online advertising. | * It also uses '''R''' to improve the efficiency of online advertising. | ||
− | |||
|- | |- | ||
Line 131: | Line 119: | ||
|| Let us now see the '''homepage''' of '''R'''. | || Let us now see the '''homepage''' of '''R'''. | ||
− | + | This is the '''homepage''' of '''The R Project for Statistical Computing'''. | |
− | This is the '''homepage''' of | + | |
|- | |- | ||
|| Highlight '''download R''' on the home page | || Highlight '''download R''' on the home page | ||
Line 138: | Line 125: | ||
|- | |- | ||
|| Highlight '''About R''' on the right side of the home page | || Highlight '''About R''' on the right side of the home page | ||
− | || Under the '''R Project''' | + | || Under the section '''R Project''', click on '''About R.''' |
− | + | ||
This will tell us more about''' R''' and its environment. | This will tell us more about''' R''' and its environment. | ||
Line 151: | Line 137: | ||
|| Highlight the Terminal on your computer | || Highlight the Terminal on your computer | ||
|| Now we will see the '''command line''' interface of '''R'''. | || Now we will see the '''command line''' interface of '''R'''. | ||
− | |||
I have already installed '''R''' on my machine. So, I will launch '''R''' from the '''terminal'''. | I have already installed '''R''' on my machine. So, I will launch '''R''' from the '''terminal'''. | ||
|- | |- | ||
|| Press '''Ctrl''' + '''Alt''' + '''T''' keys on the keyboard. | || Press '''Ctrl''' + '''Alt''' + '''T''' keys on the keyboard. | ||
− | |||
Highlight the '''Terminal.''' | Highlight the '''Terminal.''' | ||
− | |||
Type '''R''' in the terminal. | Type '''R''' in the terminal. | ||
|| Press '''Ctrl''' + '''Alt''' + '''T''' keys on the keyboard to open a '''terminal '''window. | || Press '''Ctrl''' + '''Alt''' + '''T''' keys on the keyboard to open a '''terminal '''window. | ||
− | |||
Now, in the '''terminal''', type capital '''R''' and press '''Enter'''. | Now, in the '''terminal''', type capital '''R''' and press '''Enter'''. | ||
Line 169: | Line 151: | ||
|| Highlight '''R '''command-line interface | || Highlight '''R '''command-line interface | ||
|| The '''command-line''' interface of '''R''' opens. | || The '''command-line''' interface of '''R''' opens. | ||
− | |||
In the '''terminal''', scroll up. | In the '''terminal''', scroll up. | ||
− | |||
Notice that''' R''' version 3.4.4 is installed on my machine. | Notice that''' R''' version 3.4.4 is installed on my machine. | ||
− | |||
Now, scroll down. | Now, scroll down. | ||
Line 182: | Line 161: | ||
|| Here, we can type the '''commands''' to be executed in''' R'''. | || Here, we can type the '''commands''' to be executed in''' R'''. | ||
− | + | As an example, we will evaluate the value of 10 raised to the power of 0.1. | |
− | As an example, | + | |
|- | |- | ||
|| R console: | || R console: | ||
Line 199: | Line 177: | ||
About '''RStudio''' | About '''RStudio''' | ||
− | || * '''RStudio''' is an '''integrated development environment''' for '''R'''. | + | || |
+ | * '''RStudio''' is an '''integrated development environment''' for '''R'''. | ||
* It includes a '''console''' and an '''editor'''. | * It includes a '''console''' and an '''editor'''. | ||
* It provides tools for plotting, '''debugging''' and '''workspace''' management. | * It provides tools for plotting, '''debugging''' and '''workspace''' management. | ||
− | |||
|- | |- | ||
Line 209: | Line 187: | ||
[https://rstudio.com/ https://rstudio.com/] | [https://rstudio.com/ https://rstudio.com/] | ||
|| Let us now see the '''homepage''' of '''RStudio'''. | || Let us now see the '''homepage''' of '''RStudio'''. | ||
− | |||
There is a lot of information about '''RStudio''' on this page. | There is a lot of information about '''RStudio''' on this page. | ||
− | |||
You can go through it in detail, later. | You can go through it in detail, later. | ||
Line 218: | Line 194: | ||
|| | || | ||
|| Now let’s get familiar with the '''RStudio '''interface. | || Now let’s get familiar with the '''RStudio '''interface. | ||
− | |||
I have already installed '''RStudio''' on my machine. | I have already installed '''RStudio''' on my machine. | ||
Line 225: | Line 200: | ||
|- | |- | ||
|| Highlight the '''Terminal ''' | || Highlight the '''Terminal ''' | ||
− | |||
Type '''rstudio''' and press '''Enter'''. | Type '''rstudio''' and press '''Enter'''. | ||
|| Press '''Ctrl''' + '''Alt''' + '''T''' keys together to open a new '''terminal '''window. | || Press '''Ctrl''' + '''Alt''' + '''T''' keys together to open a new '''terminal '''window. | ||
− | |||
In the '''terminal''', type '''rstudio''' and press '''Enter'''. | In the '''terminal''', type '''rstudio''' and press '''Enter'''. | ||
Line 236: | Line 209: | ||
|| '''RStudio''' is launched. | || '''RStudio''' is launched. | ||
− | + | In the left panel of '''RStudio''', we can see the '''Console''' window. | |
− | In the | + | |
− | + | ||
In the '''Console''', '''R''' is waiting for us to type a '''command'''. | In the '''Console''', '''R''' is waiting for us to type a '''command'''. | ||
− | |||
Let us draw a simple''' pie chart'''. | Let us draw a simple''' pie chart'''. | ||
Line 249: | Line 219: | ||
'''pie(1:5)''' | '''pie(1:5)''' | ||
|| In the '''Console''' window, type '''p i e''' and in parentheses one '''colon''' five. | || In the '''Console''' window, type '''p i e''' and in parentheses one '''colon''' five. | ||
− | |||
Press '''Enter'''. | Press '''Enter'''. | ||
Line 266: | Line 235: | ||
Point to the '''current working directory'''. | Point to the '''current working directory'''. | ||
|| In the bottom right panel of '''RStudio''', we have the '''Files''' tab. | || In the bottom right panel of '''RStudio''', we have the '''Files''' tab. | ||
− | |||
Click on the '''Files''' tab. | Click on the '''Files''' tab. | ||
− | |||
It shows the '''current working directory'''. | It shows the '''current working directory'''. | ||
− | |||
We will learn about other tabs later in this series. | We will learn about other tabs later in this series. | ||
Line 280: | Line 246: | ||
|- | |- | ||
|| Show Slide | || Show Slide | ||
− | |||
Installing R and RStudio | Installing R and RStudio | ||
− | + | ||
+ | # Installing R and RStudio on Linux. | ||
# Installing R and RStudio on Windows. | # Installing R and RStudio on Windows. | ||
− | + | || These two tutorials will teach how to install '''R''' and '''RStudio''' on '''Linux''' and '''Windows''' OS. | |
|- | |- | ||
|| Show Slide | || Show Slide | ||
+ | Basics of R and RStudio | ||
− | + | # Introduction to basics of R. | |
− | + | ||
# Introduction to Data Frames in R | # Introduction to Data Frames in R | ||
# Introduction to RStudio | # Introduction to RStudio | ||
Line 296: | Line 262: | ||
# Working directories in RStudio | # Working directories in RStudio | ||
+ | || These five tutorials will cover the basics of '''R, Data Frames''' in '''R''' and '''RStudio.''' | ||
|- | |- | ||
|| Show Slide | || Show Slide | ||
− | |||
Basics of data frames and lists | Basics of data frames and lists | ||
− | |||
− | |||
− | + | # Indexing and Slicing Data Frames | |
# Creating Matrices using Data Frames | # Creating Matrices using Data Frames | ||
# Operations on Matrices and Data Frames | # Operations on Matrices and Data Frames | ||
+ | || We’ll also learn how to store and analyze our '''Data Frames'''. | ||
− | |- | + | |- |
|| Show Slide | || Show Slide | ||
− | |||
Basics of data frames and lists | Basics of data frames and lists | ||
− | + | # Merging and Importing Data | |
# Data types and Factors | # Data types and Factors | ||
# Lists and its Operations | # Lists and its Operations | ||
+ | || These three tutorials and the next three tutorials will teach the basics of using '''Data frames '''and''' lists'''. | ||
|- | |- | ||
|| Show Slide | || Show Slide | ||
− | |||
Visualizing data using plots | Visualizing data using plots | ||
− | |||
− | |||
− | + | # Plotting Histograms and Pie Chart | |
# Plotting Bar Charts and Scatter Plot | # Plotting Bar Charts and Scatter Plot | ||
+ | || Next, we will learn how to visualize our data using simple plots and charts. | ||
+ | |||
+ | These two tutorials will teach how to draw '''histograms, pie charts, bar charts, '''etc. | ||
|- | |- | ||
|| Show Slide | || Show Slide | ||
− | |||
Customizing plots using ggplot2 | Customizing plots using ggplot2 | ||
− | |||
− | |||
− | + | # Introduction to ggplot2 | |
# Aesthetic Mapping in ggplot2 | # Aesthetic Mapping in ggplot2 | ||
+ | || After this, we will see how to customize our plots using the '''ggplot2 package. ''' | ||
+ | |||
+ | These two tutorials will teach how to use the '''functions''' available in the '''ggplot2 package'''. | ||
|- | |- | ||
|| Show Slide | || Show Slide | ||
− | |||
Manipulating data using dplyr | Manipulating data using dplyr | ||
− | |||
− | |||
− | + | # Data Manipulation using dplyr Package | |
# More functions in the dplyr Package | # More functions in the dplyr Package | ||
# Pipe Operator | # Pipe Operator | ||
+ | || Then we will learn how to manipulate our data using the '''dplyr package''' and '''pipe operator'''. | ||
+ | |||
+ | These three tutorials will teach how to use the '''dplyr package''' and '''pipe operator'''. | ||
|- | |- | ||
|| Show Slide | || Show Slide | ||
− | |||
Using conditional statements | Using conditional statements | ||
− | + | ||
+ | # Conditional Statements | ||
# Functions in R | # Functions in R | ||
+ | || At last, we will learn how to use '''conditional statements''' in '''R''' and to create '''user-defined functions.''' | ||
|- | |- | ||
Line 364: | Line 330: | ||
Advanced Level Topics | Advanced Level Topics | ||
− | || | + | || Later on, we may add a few more advanced level topics in this series. |
− | + | ||
+ | Please visit this series at regular intervals for the latest updates. | ||
|- | |- | ||
Line 383: | Line 349: | ||
* About '''RStudio''' and | * About '''RStudio''' and | ||
* Topics covered in this series | * Topics covered in this series | ||
− | |||
|- | |- | ||
Line 397: | Line 362: | ||
Spoken Tutorial Workshops | Spoken Tutorial Workshops | ||
|| We conduct workshops using Spoken Tutorials and give certificates. | || We conduct workshops using Spoken Tutorials and give certificates. | ||
− | |||
Please contact us. | Please contact us. | ||
Line 406: | Line 370: | ||
|| Do you have questions in THIS Spoken Tutorial? | || Do you have questions in THIS Spoken Tutorial? | ||
− | Choose the minute and second where you have the question.Explain your question briefly. | + | Please visit this site. |
+ | |||
+ | Choose the minute and second where you have the question. Explain your question briefly. | ||
Someone from the FOSSEE team will answer them. | Someone from the FOSSEE team will answer them. | ||
− | |||
− | |||
|- | |- | ||
|| Show Slide | || Show Slide | ||
Line 442: | Line 406: | ||
Acknowledgment | Acknowledgment | ||
− | || The Spoken Tutorial project is funded by | + | || The Spoken Tutorial project is funded by, MHRD, Govt. of India |
|- | |- | ||
|| Show Slide | || Show Slide |
Latest revision as of 13:31, 10 June 2020
Title of the script: Overview of R and RStudio
Author: Madhuri Ganapathi and Sudhakar Kumar (IIT Bombay)
Keywords: R, RStudio, command-line interface, pie chart, programming, video tutorial
Visual Cue | Narration |
Show slide
Opening Slide |
Welcome to this spoken tutorial on Overview of R and RStudio. |
Show slide
Learning Objectives |
In this tutorial, we will learn:
|
Show slide
System Specifications |
This tutorial is recorded on,
It is recommended to install R version 3.2.0 or higher. |
Show slide
Prerequisites |
To follow this series, the learner should have knowledge of basic Mathematics and Statistics. |
Show slide
About R |
Let us first see what R is.
|
Show slide
Features of R |
Some of its salient features are:
|
Show slide
Features of R |
|
Show slide
Features of R |
|
Show Slide
Applications of R |
R is extensively used in-
|
Show Slide
Applications of R |
|
Now, we will learn about some of the companies that use R. | |
Show Slide
Names of the companies that use R |
ANZ Bank:
|
Show Slide
Names of the companies that use R |
Facebook:
|
Names of the companies that use R | Google:
|
Web browser | Let us now see the homepage of R.
This is the homepage of The R Project for Statistical Computing. |
Highlight download R on the home page | Here, we can download R. |
Highlight About R on the right side of the home page | Under the section R Project, click on About R.
This will tell us more about R and its environment. |
I will scroll down the page. | |
Highlight Getting Help on the right side of the home page | Under the section Help With R, click on Getting Help to know how to get help. |
Highlight the Terminal on your computer | Now we will see the command line interface of R.
I have already installed R on my machine. So, I will launch R from the terminal. |
Press Ctrl + Alt + T keys on the keyboard.
Highlight the Terminal. Type R in the terminal. |
Press Ctrl + Alt + T keys on the keyboard to open a terminal window.
Now, in the terminal, type capital R and press Enter. |
Highlight R command-line interface | The command-line interface of R opens.
In the terminal, scroll up. Notice that R version 3.4.4 is installed on my machine. Now, scroll down. |
Highlight R command-line interface | Here, we can type the commands to be executed in R.
As an example, we will evaluate the value of 10 raised to the power of 0.1. |
R console:
Type 10^0.1 |
Type 10 carat sign 0.1 and press Enter. |
Highlight the value in the Terminal | The expected value is being displayed on the R terminal window. |
Now, we will learn about RStudio. | |
Show slide
About RStudio |
|
Web browser | Let us now see the homepage of RStudio.
There is a lot of information about RStudio on this page. You can go through it in detail, later. |
Now let’s get familiar with the RStudio interface.
I have already installed RStudio on my machine. So, I will launch RStudio using the terminal. | |
Highlight the Terminal
Type rstudio and press Enter. |
Press Ctrl + Alt + T keys together to open a new terminal window.
In the terminal, type rstudio and press Enter. |
Highlight the Console Window | RStudio is launched.
In the left panel of RStudio, we can see the Console window. In the Console, R is waiting for us to type a command. Let us draw a simple pie chart. |
RStudio
pie(1:5) |
In the Console window, type p i e and in parentheses one colon five.
Press Enter. |
Highlight the pie chart in the Plots window | The expected pie chart is generated in the Plots window. |
Highlight Environment and History window | Apart from this, we have Environment and History tabs.
Here all the used variables and commands are stored. |
Highlight Files window.
|
In the bottom right panel of RStudio, we have the Files tab.
Click on the Files tab. It shows the current working directory. We will learn about other tabs later in this series. |
Let’s now have a look at the content that will be covered in the R series. | |
Show Slide
Installing R and RStudio
|
These two tutorials will teach how to install R and RStudio on Linux and Windows OS. |
Show Slide
Basics of R and RStudio
|
These five tutorials will cover the basics of R, Data Frames in R and RStudio. |
Show Slide
Basics of data frames and lists
|
We’ll also learn how to store and analyze our Data Frames. |
Show Slide
Basics of data frames and lists
|
These three tutorials and the next three tutorials will teach the basics of using Data frames and lists. |
Show Slide
Visualizing data using plots
|
Next, we will learn how to visualize our data using simple plots and charts.
These two tutorials will teach how to draw histograms, pie charts, bar charts, etc. |
Show Slide
Customizing plots using ggplot2
|
After this, we will see how to customize our plots using the ggplot2 package.
These two tutorials will teach how to use the functions available in the ggplot2 package. |
Show Slide
Manipulating data using dplyr
|
Then we will learn how to manipulate our data using the dplyr package and pipe operator.
These three tutorials will teach how to use the dplyr package and pipe operator. |
Show Slide
Using conditional statements
|
At last, we will learn how to use conditional statements in R and to create user-defined functions. |
Show Slide
Advanced Level Topics |
Later on, we may add a few more advanced level topics in this series.
Please visit this series at regular intervals for the latest updates. |
This completes the overview of spoken tutorials on the R series. | |
Let us summarize. | |
Show slide
Summary |
In this tutorial, we have learned
|
Show slide
About the Spoken Tutorial Project |
The video at the following link summarises the Spoken Tutorial project.
Please download and watch it. |
Show slide
Spoken Tutorial Workshops |
We conduct workshops using Spoken Tutorials and give certificates.
Please contact us. |
Show Slide
Spoken Tutorial Forum to answer questions |
Do you have questions in THIS Spoken Tutorial?
Please visit this site. Choose the minute and second where you have the question. Explain your question briefly. Someone from the FOSSEE team will answer them. |
Show Slide
Spoken Tutorial Forum for specific questions: |
The Spoken Tutorial forum is for specific questions on this tutorial.
Please do not post unrelated and general questions on them. This will help reduce the clutter. With less clutter, we can use these discussions as instructional material. |
Show Slide
Forum to answer questions |
Do you have any general/technical questions?
Please visit the forum given in the link. |
Show Slide
Textbook Companion |
The FOSSEE team coordinates the coding of solved examples of popular books.
We give honorarium and certificates to those who do this. For more details, please visit these sites. |
Show Slide
Acknowledgment |
The Spoken Tutorial project is funded by, MHRD, Govt. of India |
Show Slide
Thank You |
This tutorial is contributed by Sudhakar Kumar and Madhuri Ganapathi from IIT Bombay. Thank you for watching. |