# Read in the functions from a separate file source('fredplot.R') # Vector listing the series to be plotted # Edit this with the indicators you want before you run the script! # # You can browse through the available series here: # http://research.stlouisfed.org/fred2/ # There is also a partial list on Wikipedia: # https://en.wikipedia.org/wiki/Federal_Reserve_Economic_Data#FRED_economic_indicators_.28partial_list.29 fred_symbols = c( "PAYEMS", "INDPRO", "PCEC96", "RRSFS", "NAPM", "HOUST" ) # The directory where the plots will be saved # You may want to change this! output_directory = "data" # Store the current working directory in a variable and switch to # the output directory specified above. oldwd <- getwd() setwd(output_directory) # This command downloads and plots each variable listed in fred_symbols, # at the top of the script. plotColumns(getFredTable(fred_symbols), plotRoutine=plotFredPDFs) # Go back to the directory we were in before setwd(oldwd)