Session Ready
Exercise

Save and load symbol lookup table

The previous exercise taught you how to set default arguments on a per-symbol basis, but those settings only last for the current session.

This exercise will teach you how to save and load symbol-based defaults by using saveSymbolLookup() and loadSymbolLookup(), respectively. You can use the file arguments to specify a file to store your defaults.

You can also use the getSymbolLookup() function to check per-symbol defaults before you try to load data using getSymbols().

Instructions
100 XP

The source for CP has already been set to "FRED".

  • Use saveSymbolLookup() to save the symbol lookup table to a file named "my_symbol_lookup.rda".
  • Set the source for CP to "yahoo" using what you learned in the prior exercise.
  • Use getSymbolLookup() to verify that the default source for CP actually changed from "FRED" to "yahoo".
  • Now use loadSymbolLookup() to load the saved symbol lookup table.