ABSTRACT

This chapter deals with quick interactive graphs with the quantmod and dygraphs packages and interactive maps with a few lines of code. R should automatically install needed packages by default, but sometimes there could be a glitch. If the user gets an error message that some other package he/she did not know about is missing, then the missing package can be installed manually with install.packages(“missingPackageName”). getSymbols() is quantmod’s powerful function for getting historical financial data from the Internet and importing it directly into R. quantmod includes a function that lets the user import data directly from the US Federal Reserve — more specifically the St. Louis Federal Reserve’s FRED database. Whether you’re a journalist or government staffer looking at a trend line like the rise in San Francisco median household income this, it is helpful to keep a key statistical question in mind: compared to what?.