if (FALSE) {
# All 3 getSymbols calls return the same
# MSFT to the global environment
# The last example is what NOT to do!
setDefaults(getSymbols.MySQL,user='jdoe',password='secret',
dbname='tradedata')
## Method #1
getSymbols('MSFT',src='MySQL')
## Method #2
setDefaults(getSymbols,src='MySQL')
# OR
setSymbolLookup(MSFT='MySQL')
getSymbols('MSFT')
#########################################
## NOT RECOMMENDED!!!
#########################################
## Method #3
getSymbols.MySQL('MSFT',env=globalenv())
}
Run the code above in your browser using DataLab