update_stocks: Download stock data

Description Usage Arguments Value Examples

Description

Used to periodically update the compiled data. Downloads data from the point till when the data is present (if nothing is present, the last 8 days) till the point we specify.

Usage

1
2
3
update_stocks(data_path = "./data", till = lubridate::today(),
  exchange = c("both", "nse", "bse"), compile = TRUE,
  delete_component_files = TRUE, quiet = FALSE)

Arguments

data_path

The path you want to update, which possibly contains the data files. Defaults to the data folder in the current working directory.

till

The date till which you want to update. Defaults to lubridate::today()

exchange

One of "both", "nse" or "bse". Defaults to "both".

compile

If FALSE, the individual downloaded files are retained and not compiled into one large file. If TRUE, the files are compiled into one large file. You can choose whether to retain just the compiled file or not, using the delete_component_files parameter. If there are other nse or bse files, even they are compiled into one and Defaults to TRUE.

delete_component_files

Works only if compile is TRUE. If TRUE, only the compiled file will be retained. If FALSE, all the individual component files will be retained.

quiet

Controls the download status message. If you do not want the download status on each day, TRUE should be specified. Defaults to FALSE.

Value

If exchange is "both", then the compiled data from both "nse" and "bse" is returned or the compiled data from whatever exchange is specified. The new files are also written as csvs in the path specified.

Examples

1
update_stocks(exchange="bse")

ilangurudev/IndianStocksR documentation built on May 12, 2019, 4:36 a.m.