Exercise

Find stock ticker from Google Finance

Before you can import data from any internet data source, you need to know the instrument identifier. These can generally be found on the website of the data source provider. In this exercise, you'll need to search Google Finance to find the ticker symbol for Pfizer stock. Looking up instrument identifiers online will be important when you want to work with data from a new instrument.

Note that some data series may not be available for download from certain providers. This may be true even if you can see the data displayed on their website in tables and/or charts. getSymbols() will throw an error if the data is not available for download.

Instructions

100xp

Create an object called symbol from the three-letter Google Finance ticker symbol for Pfizer stock. To find the symbol, go to Google Finance and search for "Pfizer". Note that there are two parts to this ticker - for our purposes, we only need what comes after the colon.

Use getSymbols() to import the data. Make sure you set the src argument!

Use the head() function to view the first few rows of the object created by getSymbols().