On Wed, Sep 30, 2015 at 8:16 PM, George Kumar <[email protected]> wrote: > Hi all, > > I use following command to make getSymbols (from quantmod package) get data > from locally stored csv files. > > setDefaults(getSymbols,src='csv') > > My problem is that if the data is not found locally, I want it to get it > from yahoo/google. How to go about doing this. If setDefaults allowed > multiple sources, it would have been possible. Something like the following: > > setDefaults(getSymbols,src='csv yahoo') > > Please let me know how this can be done. > Write your own getSymbols function, e.g. getSymbols.csv2yahoo. Then wrap your call to getSymbols.csv in a try or tryCatch call. If the getSymbols.csv call fails, you can then call getSymbols.yahoo.
> Thanks. > George > > [[alternative HTML version deleted]] > > _______________________________________________ > [email protected] mailing list > https://stat.ethz.ch/mailman/listinfo/r-sig-finance > -- Subscriber-posting only. If you want to post, subscribe first. > -- Also note that this is not the r-help list where general R questions > should go. -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com _______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
