Introduction
  • Introduction
Getting Started with R
  • Installing R and RStudio
  • The RStudio Interface
  • Installing and Activating R Packages
  • Setting the Working Directory
  • Basic Operations in R
  • Working With Variables
Vectors
  • Creating Vectors With the c() Function
  • Creating Vectors Using the Colon Operator
  • Creating Vectors With the rep() Function
  • Creating Vectors With the seq() Function
  • Creating Vectors of Random Numbers
  • Creating Empty Vectors
  • Indexing Vectors With Numeric Indices
  • Indexing Vectors With Logical Indices
  • Naming Vector Components
  • Filtering Vectors
  • The Functions all() and any()
  • Sum and Product of Vector Components
  • Vectorized Operations
  • Treating Missing Values in Vectors
  • Sorting Vectors
  • Minimum and Maximum Values
  • The ifelse() Function
  • Adding and Multiplying Vectors
  • Testing Vector Equality
  • Vector Correlation
  • Bonus Lecture: Learn Statistics with R
  • Practical Exercises
Matrices and Arrays
  • Creating Matrices With the matrix() Function
  • Creating Matrices With the rbind() and cbind() Functions
  • Naming Matrix Rows and Columns
  • Indexing Matrices
  • Filtering Matrices
  • Editing Values in Matrices
  • Adding and Deleting Rows and Columns
  • Minima and Maxima in Matrices
  • Applying Functions to Matrices (1)
  • Applying Functions to Matrices (2)
  • Applying Functions to Matrices (3)
  • Adding and Multiplying Matrices
  • Other Matrix Operations
  • Creating Multidimensional Arrays
  • Indexing Multidimensional Arrays
  • Practical Exercises
Lists
  • Create Lists With the list() Function
  • Create Lists With the vector() Function
  • Indexing Lists With Brackets
  • Indexing Lists Using Objects Names
  • Editing Values in Lists
  • Adding and Removing List Objects
  • Applying Functions to Lists
  • Practical Example of List: the Regression Analysis Output
  • Bonus Lecture: Data Analysis in R
  • Practical Exercises
Factors
  • Working With Factors
  • Splitting a Vector By a Factor Levels
  • The tapply() Function
  • The by() Function
  • Practical Exercises
Data Frames
  • Creating Data Frames
  • Loading Data Frames From External Files
  • Writing Data Frames in External Files
  • Indexing Data Frames As Lists
  • Indexing Data Frames As Matrices
  • Selecting a Random Sample of Entries
  • Filtering Data Frames
  • Editing Values in Data Frames
  • Adding Rows and Columns to Data Frames
  • Naming Rows and Columns in Data Frames
  • Applying Functions to Data Frames
  • Sorting Data Frames
  • Shuffling Data Frames
  • Merging Data Frames
  • Practical Exercises
Programming Structures
  • For Loops
  • While Loops
  • Repeat Loops
  • Nested For Loops
  • Conditional Statements
  • Nested Conditional Statements
  • Loops and Conditional Statements
  • User Defined Functions
  • The Return Command
  • More Complex Functions Examples
  • Checking Whether an Integer Is a Perfect Square
  • A Custom Function That Solves Quadratic Equations
  • Binary Operations
  • Practical Exercises
Working With Strings
  • Creating Strings
  • Printing Strings