joshuaulrich / rfimport

getSymbols() reboot
16 stars 2 forks source link

Combine 'from' and 'to' arguments into one 'dates' argument #10

Closed joshuaulrich closed 1 year ago

joshuaulrich commented 1 year ago

Allow users to specify the start and end datetimes in one ISO-8601 style string. This is very helpful during interactive use. For example:

spy <- import_ohlc(sym_yahoo("SPY"), dates = "2000/2020")
# instead of
spy <- import_ohlc(sym_yahoo("SPY"), from = "2000-01-01", to = "2020-12-31")

There's also an argument for dates to be a 2-element Date or POSIXt vector. Then users won't have to do dates = paste(from, to, sep = "/") if they have start/end times in separate from and to objects.