Introduction
Getting Started with R
Overview of R
Why Use R in Finance?
Setting up the R Working Environment
Installing RStudio
Running R
Learning the Basics of R Programming
Overview of R Programming Fundamental Concepts
Vectors
Matrices
Arrays
Data Frames
Factors
Lists
Implementing Your First R Script: Basic Arithmetic with R
Assigning Values to Variables in R
Understanding Financial Returns
Implementing Financial Returns Calculations on R
Listing Objects in R
Understanding Object Data Types and Storage Modes in R
Understanding Object Classes
Using Vectors
Using the c() (Combine) Function to Create Vecors
Using Vector names()
Visualizing Vectors
Vector Operations
Indexing Vectors
Subsetting Vectors
Stock Prices Example: Calculating Weighted Averages Using Vectors
Using Matrices
Creating a Matrix
Binding Vectors to Form Matrices
Visualizing Matrices
Using the cor() (Correlation) Function
Subsetting Matrices
Using Data Frames
Overview of Data Frames
Creating Your First data.frame()
The Contents of a Data Frame
Using the head(), tail(), and str() (Structure) Functions
Using Row and Column Names
Manipulating Data Frames
Accessing Data Frames
Subsetting Data Frames
Adding New Columns
Understanding Present Value in Finance
Calculating the Present Value of Projected Cash Flows Using R
Using Factors
Overview of Factors
Creating a Factor
Implementing Factor Levels
Using the Factor Summary Function
Visualizing Factors
Bond Credit Ratings Example: Creating a Factor from a Numeric Vector
Ordering Factors
Subsetting Factors
Using Strings as Factors
Using Lists
Overview of Lists
Creating a List
Implementing Named Lists
Accessing List Elements
Adding Elements to a List
Removing Elements from a List
Creating Lists Using Functions
Splitting a List
Stocks Portfolio Example: Implementing Split-Apply-Combine to Your List
Using Attributes
Troubleshooting
Summary and Conclusion
Closing Remarks