When I call getSymbols() for a date for which there is no data, it throws an error.
Expected behavior
Should return an empty data frame.
Minimal, reproducible example
> library(quantmod)
>
> ## trying to get saturday and sunday data
> a = getSymbols(
'AAPL',
src='yahoo',
from='2023-11-04', # saturday (inclusive)
to='2023-11-06', # monday (exclusive)
auto.assign=FALSE
)
Error in getSymbols.yahoo(Symbols = "AAPL", env = <environment>, verbose = FALSE, :
Unable to import “AAPL”.
attempt to set an attribute on NULL
Description
When I call getSymbols() for a date for which there is no data, it throws an error.
Expected behavior
Should return an empty data frame.
Minimal, reproducible example
Session Info