Plotting the VIX Index and TED Spread in R

Premium

In this lesson, will will look at how to create the two graphs in R. Before you start, it is important to setup your basic environment:

Setup Environment

Open RStudio and ensure that you have the basic setup in place.

  • Create a new directory called ‘quantative-trading-strategies-r’ in your computer. We will use this director for all the exercises in this course.
  • Set this directory as your working directory using the setwd() command. You can also check the current working directory using the getwd() command in R console.
  • Use the command CTRL+L to clear the console (Use this whenever you feel the console is cluttered).
  • Create a new R script where we will be writing our R script.
  • Install and load the ggplot2 package by typing the following commands in the console:

Unlock Premium Content

Upgrade your account to access the full article, downloads, and exercises.

You'll get access to:

  • Access complete tutorials and examples
  • Download source code and resources
  • Follow along with practical exercises
  • Get in-depth explanations