quantmod
quantmod copied to clipboard
getSymbolLookup() doesn't return NULL after all lookups are removed
Users might be confused that getSymbolLookup()
returns NULL
if you call it when no lookups have been set, but returns named list()
if you call it after all lookups have been removed.
R> getSymbolLookup()
NULL
R> setSymbolLookup(AAPL = "google")
R> setSymbolLookup(AAPL = NULL)
R> getSymbolLookup()
named list()
Should try to make both calls return NULL
.
I see two ways to do this. One is to set the getSymbols.sources
option to NULL
in setSymbolLookup
when the symbol lookup list has zero length. The other is to return NULL
from getSymbolLookup
when the symbol lookup list has zero length.
In the latter case, the getSymbols.sources
option would still exist and would be a length-zero named list. It makes more sense to me to remove the option entirely if there are no symbol lookups.
Might also want to consider adding a warning/error to saveSymbolLookup
and loadSymbolLookup
if there are no symbol lookups to save or load.