Difference between revisions of "R"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
(54 intermediate revisions by 3 users not shown)
Line 1: Line 1:
+
'''R''' ( http://www.r-project.org/) is an open source software - a well organized and sophisticated package - that facilitates data analysis, modeling, inferential testing and forecasting. It is a user friendly software which allows to create new function commands to solve statistical problems. It runs on a variety of UNIX platforms (and similar systems such as LINUX), Windows and Mac OS.
  
'''R''' ( http://www.r-project.org/) is an open source software- a well organized and sophisticated package- that facilitates data analysis, modeling, inferential testing and forecasting. It is a user friendly software which allows to create new function commands to solve statistical problems. It runs on a variety of UNIX platforms(and similar systems such as LINUX), Windows and Mac OS.
+
'''R''' is the most preferred open-source language for analytics and data science. At Microsoft, R is used by its data scientists, who apply machine learning to data from Bing, Azure, Office, and the Sales, Marketing, and Finance departments. Twitter has been using R for measuring user-experience.  On the other hand, the cross-platform compatibility of R and its capacity to handle large and complex data sets make it an ideal tool for academicians to analyze data in their labs.
 +
 
 +
'''R''' can be used for simple calculations, matrix calculations, differential equations, optimisation, statistical analysis, plotting graphs, etc. Also, it is useful to anybody who wishes to undertake extensive statistical computations and data visualization.  
  
R is a free, useful software package to anybody who wishes to undertake extensive statistical computations (a user community that includes students, researchers and professionals belonging to various disciplines).  
+
The spoken tutorials (ST) for R series was initially created by '''Prof. Kannan Moudgalya, IIT Bombay'''.  Later, the domain expert for this series was '''Prof. Radhendushka Srivastava, Maths Dept. IIT Bombay'''. Content for this series was contributed by FOSSEE Fellows 2018 Shaik Sameer and Varshit Dubey and the tutorials were recorded by Sudhakar Kumar, M.Tech student IIT Bombay. Overall coordination for the series was done by Smita Wangikar from FOSSEE project, IIT Bombay. Madhuri Ganapati and Vidhya Iyer from Spoken Tutorial project, IIT Bombay, were the reviewers from ST end.
  
The Centre for Computational Social Sciences, UPE programme (under the UGC scheme), University of Mumbai, is leading the initiative of popularizing R in India which is part of the Free and Open source Software for Science and Engineering Education (FOSSEE) project, supported by the National Mission on Education through ICT of MHRD (http://spoken-tutorial.org/NMEICT-Intro).
 
  
The Centre for Computational Social Sciences is using Spoken Tutorials (http://spoken-tutorial.org/) to create learning resources for FOSS. This is the main page for the organization of the scripts required for R spoken tutorials. We invite the R user community to participate in this activity.
+
'''Learners:''' Analysts, researchers, statistics students
 
+
<blockquote style="background-color: lemonchiffon; border: solid thin grey;">
+
[[R Slide Template]]  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
+
[[R/Glossary|Glossary]]
+
</blockquote>
+
  
 
__TOC__
 
__TOC__
  
 +
'''Note:''' Each numbered topic corresponds to a single spoken tutorial. Each bulleted point corresponds to a command or topic that must be covered in the given spoken tutorial.
  
=== BASIC LEVEL TUTORIALS ===
+
#'''Overview of R and RStudio'''
''' Introductory sessions in R'''  
+
#*About '''R''' programming language
#Installing R  
+
#*Features of '''R'''
#*Downloading and installing R
+
#*Applications of '''R'''
#Basic operations in the R console &nbsp; &nbsp;[[/Basic_Level/Introductory_sessions_in_R/Basics_in_R |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#*Discuss the contents available on the '''R''' Project website
#*To open the R console
+
#*Use the command-line interface of '''R'''
#*To run commands in R
+
#*About '''RStudio'''
#*To correct errors made in the R commands
+
#*Features of '''RStudio'''
#*To save work done in R  
+
#*Discuss the contents available on the '''RStudio''' website
#*To quit the R console
+
#*Explain the interface of '''RStudio'''
#Documentation and Packages in R &nbsp; &nbsp;[[/Basic_Level/Introductory_sessions_in_R/Documentation_on_R |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#*Topics covered in this series
#*To access installed documentation and packages in R
+
#'''Installing R and RStudio on Linux'''
#*To install and load packages in R
+
#*Install '''R''' on Linux
#:''' Data structures'''
+
#*Use the command-line interface of '''R'''
#Variables and Vectors in R &nbsp; &nbsp;[[/Basic_Level/Data_structures/Variables_and_Vectors_in_R |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#*Show the value of the exponential function in R  
#*Creation and deletion of variables and vectors
+
#*Install <code>wget</code> utility
#*Listing the vectors
+
#*Install <code>gdebi</code> utility
#*Modifying vectors
+
#*Install '''RStudio''' on Linux
#*Creating row and column vectors
+
#*Launch '''RStudio''' on Linux
#Vector Algebra and Matrices in R &nbsp; &nbsp;[[/Basic_Level/Data_structures/Vector_Algebra_and_Matrices_in_R |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#*Run a plot in '''RStudio'''
#*Vector algebra
+
#*View packages in '''RStudio'''
#*Creating matrices
+
#*Install packages
#*Matrix operations
+
#'''Installing R and RStudio on Windows'''
#Sequences, lists, strings and dates in R &nbsp; &nbsp;[[/Basic_Level/Data_structures/Sequences_lists_strings_dates |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#*Install R on Windows 10
#*Creation of sequences and lists
+
#*Launch R
#*Modifying lists, selecting elements from a list
+
#*Use command-line-interface of R
#*Modifying strings, substrings
+
#*Run an <code>exp</code> command in R
#*Date-string conversion
+
#*Install '''RStudio''' on Windows
#*Other functions related to dates
+
#*Launch '''RStudio''' on Windows
#Handling data in R &nbsp; &nbsp;[[/Basic_Level/Data_structures/Handling_data_in_R|(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#*Run a plot in '''RStudio'''
#*Creating and modifying data frames
+
#*Install packages
#*Reading data stored in files of different formats
+
#'''Introduction to basics of R'''
#:''' Basic computations in R'''  
+
#*Version of '''R''' and '''RStudio''' used
#Elementary operations in R &nbsp; &nbsp;[[/Basic_Level/Basic_computations_in_R/Elementary_operations_in_R |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#*Operating systems on which these run
#*Arithmetic
+
#*Quick intro to '''R''' and '''RStudio'''
#*Higher powers and roots of a number
+
#*Resizing the font and window size
#*Logarithms and exponentials
+
#*Using <code>+</code>, <code>-</code>, <code>^</code>, <code>sqrt</code>
#*Operations on complex numbers
+
#*Using <code>exp</code>, <code>log</code>, <code>sin</code>
#Measures of central tendency and dispersion &nbsp; &nbsp;[[/Basic_Level/Basic_computations_in_R/Measures_ of_central_tendency_and_dispersion |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#*Different ways of invoking <code>log</code>
#*Mean, median and mode
+
#*Vectors using <code>seq</code> and <code>length</code>
#* Variance, standard deviation and quantiles
+
#*Using <code>pi</code>
#:''' Probability distributions'''
+
#*Plotting a <code>sine</code> function
#Discrete probability distributions:Binomial,Poisson and Geometric &nbsp; &nbsp;[[/Basic_Level/Probability_distributions/Discrete_Probability_distributions_Binomial_Poisson_Geometric |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#*Defining more points to get a smooth plot
#*Binomial,Poisson and Geometric densities, distribution and quantile functions, random variables
+
#*Plotting with points and as line
#Discrete probability distributions:Negative Binomial and Hypergeometric &nbsp; &nbsp;[[/Basic_Level/Probability_distributions/Discrete_Probability_distributions_NegativeBinomial_Hypergeometric |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#*Introduction to '''help'''
#*Negative Binomial and Hypergeometric densities, distribution and quantile functions, random variables
+
#'''Introduction to data frames in R'''
#Continuous probability distributions &nbsp; &nbsp;[[/Basic_Level/Probability_distributions/Continuous_Probability_distributions |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#*Storing captaincy information in '''vectors'''
#*Normal, Chi squared, F and t densities, distribution and quantile functions, random variables
+
#*Constructing a '''data frame''' using '''vectors'''
#*Log-normal, logistic, exponential and gamma densities, distribution and quantile functions, random variables
+
#*Plotting one vector of a '''data frame''' vs. another one
#*Beta, cauchy and weibull densities, distribution and quantile functions, random variables
+
#*Adding a vector to a '''data frame'''
#:''' Graphical representation of information using R '''
+
#*Saving a data frame into a '''csv''' file
#Histograms, barcharts and box plots &nbsp; &nbsp;[[/Basic_Level/Graphical_representation/Histograms_bar_charts_and_box_plots |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#*Preventing the writing of row numbers into the '''csv''' file
#*Creating histograms, addding density estimate to a histogram
+
#*Changing the contents of a '''csv''' file through a text editor
#*Creating and colouring bar charts, adding confidence intervals
+
#*Loading a '''csv''' file into a '''data frame'''
#*Creating box plots
+
#*Accessing the data sets that come with '''R'''
#Scatter diagrams, regression lines and Q-Q plots &nbsp; &nbsp;[[/Basic_Level/Graphical_representation/Sactter_diagrams_and_Q-Q_plots |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#'''Introduction to RStudio'''
#*Plotting a scatter digram, adding title, label, grid and a legend  
+
#*Features of '''RStudio'''
#*Graphing a function, a regression line (superimposing on scatter plot)
+
#*A look at the windows in '''RStudio''' interface:
#*Creating Q-Q plots
+
#**'''Source''' and '''Console''' windows
#:''' Econometrics in R'''
+
#**'''Workspace''' window
#Simple and multiple linear regression &nbsp; &nbsp;[[/Basic_Level/Econometrics_in_R/Simple_multiple_regression |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#**'''Plots''' and '''Files''' window
#* OLS, log-linear, log-log and semi-log regressions
+
#*Example to plot a simple data set     
#*Dummy variable regression, regression through the origin and with standardised coefficients
+
#*Introduction to packages in '''R'''             
#Regression Analysis &nbsp; &nbsp;[[/Basic_Level/Econometrics_in_R/Regression_analysis |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#*How to find the list of packages installed in '''R'''       
#*Confidence intervals
+
#*Installation of '''R''' packages in '''RStudio'''
#*P-values and power functions
+
#*Loading and using '''R''' packages 
#Tests for heteroskcedasticity &nbsp; &nbsp;[[/Basic_Level/Econometrics_in_R/Heteroskcedasticity |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#'''Introduction to R script'''
#*Park test
+
#*What is an '''R''' script
#*Goldfeld-Quandt test
+
#*Features of '''R''' script
#*Breusch-Pagan-Godfrey test
+
#*How to create and save an '''R''' script from the user interface (UI) of '''RStudio'''
#*White’s General Heteroskcedasticity test
+
#*Shortcut keys to create an '''R''' script
#Tests for autocorrelation and specification errors&nbsp; &nbsp;[[/Basic_Level/Econometrics_in_R/Autocorrelation_and_specification_errors |(Scripts)]]&nbsp; &nbsp; [(Spoken Tutorials)]
+
#*How to use auto-completion of commands
#* Durbin Watson test
+
#*How to run an entire script
#*Ramsey reset specification test
+
#*How to run a block of a script
 
+
#*How to add comments
=== ADVANCED LEVEL TUTORIALS ===
+
#*How to comment an existing line
# Models of microeconometrics &nbsp; &nbsp; [[/Advanced_Level/Models_of_microeconometrics |(Scripts)]] &nbsp; &nbsp; [(Spoken Tutorials)]
+
#*How to load one script into another script
#*
+
#'''Working Directories in RStudio'''
#*
+
#*What is working directory in '''R'''
# Bayesian Econometrics  &nbsp; &nbsp; [[/Advanced_Level/Bayesian_Econometrics | (Scripts)]] &nbsp; &nbsp; [(Spoken Tutorials)]
+
#*How to know current working directory
#*
+
#*How to use <code>getwd</code> function
#*
+
#*How to set a working directory from the user interface of '''RStudio'''
# Time series Econometrics  &nbsp; &nbsp; [[/Advanced_Level/Time_series_Econometrics | (Scripts)]] &nbsp; &nbsp; [(Spoken Tutorials)]
+
#*How to set a working directory from the '''Console''' window of '''RStudio'''
#*
+
#*How to use <code>setwd</code> function
#*
+
#*How to read and store a '''csv''' file in '''R'''
# Programming your own analysis  &nbsp; &nbsp; [[/Advanced_Level/Programming_your_own_analysis | (Scripts)]] &nbsp; &nbsp; [(Spoken Tutorials)]
+
#*How to use <code>read.csv</code> function
#*
+
#*How to view a stored '''csv''' file in '''R'''
#*
+
#*How to use <code>View</code> function
 +
#'''Indexing and Slicing Data Frames'''
 +
#*Shortcut key for assignment operator (<code><-</code>)
 +
#*How to perform numeric indexing
 +
#*How to extract a row or column from a data frame
 +
#*How to retrieve multiple rows from a data frame
 +
#*How to combine objects to form a vector
 +
#*How to perform logical indexing on a data frame
 +
#*How to perform name indexing on a data frame
 +
#*How to slice a data frame using <code>subset</code> function
 +
#*How to select required columns (by name) from a data frame
 +
#*How to retrieve data using double square brackets
 +
#'''Creating Matrices using Data Frames'''
 +
#*Data required in a matrix format
 +
#*Convert a data frame into a matrix
 +
#*Create a matrix with known data
 +
#*Add two matrices
 +
#*Subtract two matrices
 +
#*Multiply two matrices element wise
 +
#*Perform true matrix multiplication
 +
#*Calculate the transpose of a matrix
 +
#*Calculate the determinant of a matrix
 +
#'''Operations on Matrices and Data Frames'''
 +
#*How to find the inverse of a matrix
 +
#*How to calculate the sum of elements in a matrix using <code>for</code> loop
 +
#*How to calculate the sum of elements in a matrix using <code>sum</code> function
 +
#*How to calculate the time elapsed in an operation
 +
#*How to find out the sum of rows of a matrix
 +
#*How to find out the sum of columns of a matrix
 +
#*How to add a new column or row to an existing data-frame
 +
#*How to use <code>cbind</code> and <code>rbind</code> function
 +
#'''Merging and Importing Data'''
 +
#*Use of built-in functions in '''R''' for exploring a data frame
 +
#*Access help in '''RStudio'''
 +
#*Advantages of merging data frames
 +
#*Merge two data frames
 +
#*Import data from the command line
 +
#*Import <code>xml</code> file and <code>txt</code> file in R
 +
#*Import data from the user interface of '''RStudio'''
 +
#'''Data Types and Factors'''
 +
#*What is an object in '''R'''
 +
#*Types of '''R''' - objects
 +
#*What is an atomic vector in '''R'''
 +
#*Types of atomic vectors
 +
#*How to find types of vectors
 +
#*Factors in '''R'''
 +
#*Levels of a factor in '''R'''
 +
#*Identification of categorical variables
 +
#*How to change the type of a vector
 +
#*How to change the values of levels
 +
#'''Lists and its Operations'''
 +
#*Lists in '''R'''
 +
#*Atomic vectors in '''R'''
 +
#*Difference between atomic vectors and lists in '''R'''
 +
#*How to create a list
 +
#*How to assign names to the elements of a list
 +
#*Named list in '''R'''  
 +
#*How to access elements of a list by its index
 +
#*How to access an element of a list by its name
 +
#*How to access an element of an element of a list
 +
#*Combine two different lists
 +
#'''Plotting Histograms and Pie Chart'''
 +
#*How to find the dimensions of a data frame
 +
#*Define a histogram
 +
#*Plot a histogram in '''R'''
 +
#*Add labels to the histogram
 +
#*Add color to the bins of a histogram
 +
#*Change the number of breaks in the histogram
 +
#*Define a pie chart
 +
#*Plotting a pie chart in '''R'''
 +
#*Add a label to the pie chart
 +
#*Saving the plot as an image
 +
#'''Plotting Bar Charts and Scatter Plot'''
 +
#*What is a bar chart
 +
#*Draw a bar chart
 +
#*Use the <code>barplot</code> function
 +
#*Add labels to the bar chart
 +
#*Adjust the labels of the bar chart
 +
#*What is a scatter plot
 +
#*Draw a scatter plot
 +
#*Use <code>plot</code> function with two objects 
 +
#*Find the correlation coefficient 
 +
#*Range of correlation coefficient
 +
#'''Introduction to ggplot2'''
 +
#*Define visualization
 +
#*About grammar of graphics - '''ggplot2'''
 +
#*Use of the <code>plot</code> function
 +
#*Add labels to a plot
 +
#*Change the color and type of plot
 +
#*Plot two graphs in the same plot
 +
#*Add a legend to the plot
 +
#*About '''ggplot2''' package
 +
#*Draw a scatter plot using <code>ggplot</code> function
 +
#*Save plots using <code>ggsave</code> function
 +
#'''Aesthetic Mapping in ggplot2'''
 +
#*Define aesthetic
 +
#*Need for aesthetic in plotting
 +
#*Draw a scatter plot
 +
#*Customize a scatter plot
 +
#*View the structure of an object
 +
#*View the levels of a categorical variable
 +
#*Draw a bar chart using <code>ggplot</code>
 +
#*Add labels to a plot in <code>ggplot</code>
 +
#*Use the <code>fill</code> argument in aesthetic mapping
 +
#*Draw a histogram using <code>ggplot</code>
 +
#'''Data Manipulation using dplyr Package'''
 +
#*What is data visualization
 +
#*Need for data manipulation
 +
#*What is '''dplyr''' package
 +
#*Functions in '''dplyr''' package 
 +
#*Install '''dplyr''' package
 +
#*Use <code>filter</code> function
 +
#*Use <code>filter</code> function with a logical operator
 +
#*Use '''match''' operator
 +
#*Use <code>arrange</code> function for ascending order
 +
#*Use <code>arrange</code> function for descending order
 +
#'''More functions in the dplyr Package'''
 +
#*Functions in the '''dplyr''' package
 +
#*Select multiple variables in a data frame
 +
#*Remove variables from a data frame
 +
#*Use of <code>select</code> function
 +
#*Use of <code>starts_with</code> function
 +
#*Change the name of a variable
 +
#*Use of <code>rename</code> function
 +
#*Create a new variable from existing variables
 +
#*Use of <code>mutate</code> function
 +
#*Property of <code>mutate</code> function
 +
#'''Pipe Operator'''
 +
#*About <code>summarise</code> function in '''dplyr''' package
 +
#*About <code>group_by</code> function in '''dplyr''' package  
 +
#*Difference between <code>summarise</code> and <code>group_by</code> functions
 +
#*Use <code>summarise</code> and <code>group_by</code> functions together
 +
#*About '''pipe''' operator
 +
#*Examples of '''pipe''' operator
 +
#*Benefits of using '''pipe''' operator
 +
#*Use '''ggplot2''' and '''dplyr''' package together using '''pipe'''
 +
#*Plot '''boxplot'''
 +
#*Use <code>count</code> in <code>summarise</code> function
 +
#'''Conditional Statements'''
 +
#*About conditional statements
 +
#*Syntax of <code>if</code>, <code>else</code> and <code>else if</code> statements
 +
#*Use <code>if</code>, <code>else</code> and <code>else if</code> statements
 +
#*Use <code>ifelse</code> function
 +
#*Arguments of <code>ifelse</code> function
 +
#*Add a new column in an existing data frame
 +
#*Read and store a <code>csv</code> file
 +
#*View a data frame
 +
#*Count true values in a column
 +
#*Use <code>sum</code> function
 +
#'''Functions in R'''
 +
#*About functions
 +
#*About '''built-in''' functions and '''user-defined''' functions
 +
#*Need for '''user-defined''' functions
 +
#*Syntax of a function
 +
#*Parts of a function
 +
#*Create a '''user-defined''' function with arguments
 +
#*Create a '''user-defined''' function without arguments
 +
#*About <code>readline</code> function
 +
#*Scope of variables
 +
#*Use the <code>return</code> function

Latest revision as of 11:57, 11 October 2021

R ( http://www.r-project.org/) is an open source software - a well organized and sophisticated package - that facilitates data analysis, modeling, inferential testing and forecasting. It is a user friendly software which allows to create new function commands to solve statistical problems. It runs on a variety of UNIX platforms (and similar systems such as LINUX), Windows and Mac OS.

R is the most preferred open-source language for analytics and data science. At Microsoft, R is used by its data scientists, who apply machine learning to data from Bing, Azure, Office, and the Sales, Marketing, and Finance departments. Twitter has been using R for measuring user-experience. On the other hand, the cross-platform compatibility of R and its capacity to handle large and complex data sets make it an ideal tool for academicians to analyze data in their labs.

R can be used for simple calculations, matrix calculations, differential equations, optimisation, statistical analysis, plotting graphs, etc. Also, it is useful to anybody who wishes to undertake extensive statistical computations and data visualization.

The spoken tutorials (ST) for R series was initially created by Prof. Kannan Moudgalya, IIT Bombay. Later, the domain expert for this series was Prof. Radhendushka Srivastava, Maths Dept. IIT Bombay. Content for this series was contributed by FOSSEE Fellows 2018 Shaik Sameer and Varshit Dubey and the tutorials were recorded by Sudhakar Kumar, M.Tech student IIT Bombay. Overall coordination for the series was done by Smita Wangikar from FOSSEE project, IIT Bombay. Madhuri Ganapati and Vidhya Iyer from Spoken Tutorial project, IIT Bombay, were the reviewers from ST end.


Learners: Analysts, researchers, statistics students


Note: Each numbered topic corresponds to a single spoken tutorial. Each bulleted point corresponds to a command or topic that must be covered in the given spoken tutorial.

  1. Overview of R and RStudio
    • About R programming language
    • Features of R
    • Applications of R
    • Discuss the contents available on the R Project website
    • Use the command-line interface of R
    • About RStudio
    • Features of RStudio
    • Discuss the contents available on the RStudio website
    • Explain the interface of RStudio
    • Topics covered in this series
  2. Installing R and RStudio on Linux
    • Install R on Linux
    • Use the command-line interface of R
    • Show the value of the exponential function in R
    • Install wget utility
    • Install gdebi utility
    • Install RStudio on Linux
    • Launch RStudio on Linux
    • Run a plot in RStudio
    • View packages in RStudio
    • Install packages
  3. Installing R and RStudio on Windows
    • Install R on Windows 10
    • Launch R
    • Use command-line-interface of R
    • Run an exp command in R
    • Install RStudio on Windows
    • Launch RStudio on Windows
    • Run a plot in RStudio
    • Install packages
  4. Introduction to basics of R
    • Version of R and RStudio used
    • Operating systems on which these run
    • Quick intro to R and RStudio
    • Resizing the font and window size
    • Using +, -, ^, sqrt
    • Using exp, log, sin
    • Different ways of invoking log
    • Vectors using seq and length
    • Using pi
    • Plotting a sine function
    • Defining more points to get a smooth plot
    • Plotting with points and as line
    • Introduction to help
  5. Introduction to data frames in R
    • Storing captaincy information in vectors
    • Constructing a data frame using vectors
    • Plotting one vector of a data frame vs. another one
    • Adding a vector to a data frame
    • Saving a data frame into a csv file
    • Preventing the writing of row numbers into the csv file
    • Changing the contents of a csv file through a text editor
    • Loading a csv file into a data frame
    • Accessing the data sets that come with R
  6. Introduction to RStudio
    • Features of RStudio
    • A look at the windows in RStudio interface:
      • Source and Console windows
      • Workspace window
      • Plots and Files window
    • Example to plot a simple data set
    • Introduction to packages in R
    • How to find the list of packages installed in R
    • Installation of R packages in RStudio
    • Loading and using R packages
  7. Introduction to R script
    • What is an R script
    • Features of R script
    • How to create and save an R script from the user interface (UI) of RStudio
    • Shortcut keys to create an R script
    • How to use auto-completion of commands
    • How to run an entire script
    • How to run a block of a script
    • How to add comments
    • How to comment an existing line
    • How to load one script into another script
  8. Working Directories in RStudio
    • What is working directory in R
    • How to know current working directory
    • How to use getwd function
    • How to set a working directory from the user interface of RStudio
    • How to set a working directory from the Console window of RStudio
    • How to use setwd function
    • How to read and store a csv file in R
    • How to use read.csv function
    • How to view a stored csv file in R
    • How to use View function
  9. Indexing and Slicing Data Frames
    • Shortcut key for assignment operator (<-)
    • How to perform numeric indexing
    • How to extract a row or column from a data frame
    • How to retrieve multiple rows from a data frame
    • How to combine objects to form a vector
    • How to perform logical indexing on a data frame
    • How to perform name indexing on a data frame
    • How to slice a data frame using subset function
    • How to select required columns (by name) from a data frame
    • How to retrieve data using double square brackets
  10. Creating Matrices using Data Frames
    • Data required in a matrix format
    • Convert a data frame into a matrix
    • Create a matrix with known data
    • Add two matrices
    • Subtract two matrices
    • Multiply two matrices element wise
    • Perform true matrix multiplication
    • Calculate the transpose of a matrix
    • Calculate the determinant of a matrix
  11. Operations on Matrices and Data Frames
    • How to find the inverse of a matrix
    • How to calculate the sum of elements in a matrix using for loop
    • How to calculate the sum of elements in a matrix using sum function
    • How to calculate the time elapsed in an operation
    • How to find out the sum of rows of a matrix
    • How to find out the sum of columns of a matrix
    • How to add a new column or row to an existing data-frame
    • How to use cbind and rbind function
  12. Merging and Importing Data
    • Use of built-in functions in R for exploring a data frame
    • Access help in RStudio
    • Advantages of merging data frames
    • Merge two data frames
    • Import data from the command line
    • Import xml file and txt file in R
    • Import data from the user interface of RStudio
  13. Data Types and Factors
    • What is an object in R
    • Types of R - objects
    • What is an atomic vector in R
    • Types of atomic vectors
    • How to find types of vectors
    • Factors in R
    • Levels of a factor in R
    • Identification of categorical variables
    • How to change the type of a vector
    • How to change the values of levels
  14. Lists and its Operations
    • Lists in R
    • Atomic vectors in R
    • Difference between atomic vectors and lists in R
    • How to create a list
    • How to assign names to the elements of a list
    • Named list in R
    • How to access elements of a list by its index
    • How to access an element of a list by its name
    • How to access an element of an element of a list
    • Combine two different lists
  15. Plotting Histograms and Pie Chart
    • How to find the dimensions of a data frame
    • Define a histogram
    • Plot a histogram in R
    • Add labels to the histogram
    • Add color to the bins of a histogram
    • Change the number of breaks in the histogram
    • Define a pie chart
    • Plotting a pie chart in R
    • Add a label to the pie chart
    • Saving the plot as an image
  16. Plotting Bar Charts and Scatter Plot
    • What is a bar chart
    • Draw a bar chart
    • Use the barplot function
    • Add labels to the bar chart
    • Adjust the labels of the bar chart
    • What is a scatter plot
    • Draw a scatter plot
    • Use plot function with two objects
    • Find the correlation coefficient
    • Range of correlation coefficient
  17. Introduction to ggplot2
    • Define visualization
    • About grammar of graphics - ggplot2
    • Use of the plot function
    • Add labels to a plot
    • Change the color and type of plot
    • Plot two graphs in the same plot
    • Add a legend to the plot
    • About ggplot2 package
    • Draw a scatter plot using ggplot function
    • Save plots using ggsave function
  18. Aesthetic Mapping in ggplot2
    • Define aesthetic
    • Need for aesthetic in plotting
    • Draw a scatter plot
    • Customize a scatter plot
    • View the structure of an object
    • View the levels of a categorical variable
    • Draw a bar chart using ggplot
    • Add labels to a plot in ggplot
    • Use the fill argument in aesthetic mapping
    • Draw a histogram using ggplot
  19. Data Manipulation using dplyr Package
    • What is data visualization
    • Need for data manipulation
    • What is dplyr package
    • Functions in dplyr package
    • Install dplyr package
    • Use filter function
    • Use filter function with a logical operator
    • Use match operator
    • Use arrange function for ascending order
    • Use arrange function for descending order
  20. More functions in the dplyr Package
    • Functions in the dplyr package
    • Select multiple variables in a data frame
    • Remove variables from a data frame
    • Use of select function
    • Use of starts_with function
    • Change the name of a variable
    • Use of rename function
    • Create a new variable from existing variables
    • Use of mutate function
    • Property of mutate function
  21. Pipe Operator
    • About summarise function in dplyr package
    • About group_by function in dplyr package
    • Difference between summarise and group_by functions
    • Use summarise and group_by functions together
    • About pipe operator
    • Examples of pipe operator
    • Benefits of using pipe operator
    • Use ggplot2 and dplyr package together using pipe
    • Plot boxplot
    • Use count in summarise function
  22. Conditional Statements
    • About conditional statements
    • Syntax of if, else and else if statements
    • Use if, else and else if statements
    • Use ifelse function
    • Arguments of ifelse function
    • Add a new column in an existing data frame
    • Read and store a csv file
    • View a data frame
    • Count true values in a column
    • Use sum function
  23. Functions in R
    • About functions
    • About built-in functions and user-defined functions
    • Need for user-defined functions
    • Syntax of a function
    • Parts of a function
    • Create a user-defined function with arguments
    • Create a user-defined function without arguments
    • About readline function
    • Scope of variables
    • Use the return function

Contributors and Content Editors

Manivel, Nancyvarkey, Sudhakarst