Course Outline

Introduction

Refresher on R Programming Basics

Creating Dates and Times in R

  • Overview of Data Classes for Dates and Times
  • Exploring Your First Date and Time Objects
  • Creating Dates from Character Strings
  • Using Vectors to Create Multiple Dates from Character Strings
  • Specifying Date Formats
  • Converting Between Date Formats
  • Getting Time Intervals Between Dates
  • Extracting Date Components Using Functions

Using If Statements and Operators in R

  • Overview of the Exercise: Creating a Program for Buying or Selling Stocks
  • Using Relational Operators
  • Comparing Vectors Using Relational Operators
  • Using Logical Operators
    • Implementing And/Or
    • Implementing Not
    • Using Subsets with Data Frames and Logical Operators
  • Hands On: Creating Your Stocks Program by Combining Relational and Logical Operators
  • Using If Statements
    • Exploring the Basic If Structure
    • Implementing If-Else Statements
    • Implementing Nested If Statements
    • Using the ifelse() Function

Implementing Loops in R

  • Implementing Repeat Loops Using Stock Prices Example
  • Implementing Break Points
  • Implementing While Loops Using Debt Example
    • Using While Loops with Printing Function
    • Creating Plots Using While Loops
    • Using Break and If Statements in While Loops
  • Implementing For Loops Using Stocks Example
    • Looping Over Vectors
    • Looping Over Data Frame Rows
    • Looping Over Matrix Elements
    • Using Break and Next

Implementing Functions in R

  • Overview of Functions
  • Getting Help with Functions and Reading Documentations
  • Using Arguments and Optional Arguments
  • Implementing Nested Functions
  • Creating Your First Function: Turning Percentage into a Decimal
  • Implementing Multiple Arguments in Your Custom Function
  • Creating a Function to Calculate Present Value
  • Understanding Function Scoping
  • Introduction to Packages Using tidyquant

Using Apply Functions in R

  • Using Apply Functions to Perform Complicated Calculations
  • Implementing lapply() on a List
  • Implementing lapply() on a Data Frame Using Sharpe Ratio Example
  • Using FUN Arguments in lapply() to Improve the Sharpe Ratio Function
  • Using sapply() to Simplify Apply
  • Exercise: Examining a Sample Program on the Stock Market Crash List
  • Using vapply() and FUN.VALUE
  • Using Anonymous Functions

Troubleshooting

Summary & Conclusion

Requirements

  • Experience in basics of R programming
  • A basic understanding of finance concepts
  21 Hours
 

Testimonials (5)

Related Courses

Related Categories