Learn R Programming

fHMM (version 0.3.0)

download_data: Data download

Description

Download financial data from https://finance.yahoo.com.

Usage

download_data(
  name = NA,
  symbol = NA,
  from = "1902-01-01",
  to = Sys.Date(),
  show_symbols = FALSE,
  path
)

Arguments

name

A character, personal identifier for a stock, default NA.

symbol

A character, the stock's symbol, default NA.

from

A date, setting the lower data bound, default is "1902-01-01".

to

A date, setting the upper data bound, default is the current date Sys.date().

show_symbols

A boolean, determining whether all saved symbols should be printed, default FALSE.

path

A character, setting the data saving path.

Value

No return value. Downloaded data is saved as "name.csv" in the folder "path/data".

Details

symbol has to match the official symbol on https://finance.yahoo.com. Once used stock symbols are saved in "stock_symbols.rds" in the folder "path/data". Values for from earlier than its default value are set to the default value.

Examples

Run this code
# NOT RUN {
### download 21st century DAX data
download_data(name="dax",symbol="^GDAXI",from=as.Date("2000-01-03"),path=tempdir())
# }

Run the code above in your browser using DataLab