Description Usage Arguments Details Value Examples
This is a convenience function for exercises in the Data Computing book. It reads stock prices and dividends over a specified time interval.
1 2 | read_stock_prices(symbols = "F", what = c("prices", "daily", "weekly",
"monthly", "dividends"), start_year = 1972, end_year = 2015)
|
symbols |
a single character string or a vector of character strings specifying a stock listed on yahoo.finance. |
what |
whether to read prices or dividends. For prices, use one of |
startYear |
the lower end of the time interval for which to download data |
endYear |
the upper end of the time interval |
This function relies on the finance.yahoo.com API as it exists in early 2015.
A data frame. One column in the data frame lists the stock symbol. This is useful when reading data for more than one stock.
1 | ## Not run: CarStocks <- readStockPrices("F", "monthly", 1995, 2012)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.