EVOLUTION-MANAGER
Edit File: setSymbolLookup.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Manage Symbol Lookup Table</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for setSymbolLookup {quantmod}"><tr><td>setSymbolLookup {quantmod}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Manage Symbol Lookup Table </h2> <h3>Description</h3> <p>Create and manage Symbol defaults lookup table within <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> session for use in <code>getSymbols</code> calls. </p> <h3>Usage</h3> <pre> setSymbolLookup(...) getSymbolLookup(Symbols=NULL) saveSymbolLookup(file,dir="") loadSymbolLookup(file,dir="") </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p> name=value pairs for symbol defaults </p> </td></tr> <tr valign="top"><td><code>Symbols</code></td> <td> <p> name of symbol(s) </p> </td></tr> <tr valign="top"><td><code>file</code></td> <td> <p> filename </p> </td></tr> <tr valign="top"><td><code>dir</code></td> <td> <p> directory of filename </p> </td></tr> </table> <h3>Details</h3> <p>Use of these functions allows the user to specify a set of default parameters for each <code>Symbol</code> to be loaded. </p> <p>Different sources (e.g. yahoo, MySQL, csv), can be specified for each Symbol of interest. The sources must be <em>valid</em> <code>getSymbols</code> methods - see <code>getSymbols</code> for details on which methods are available, as well as how to add additional methods. </p> <p>The argument list to <code>setSymbolLookup</code> is simply the unquoted name of the <code>Symbol</code> matched to the desired default source, or list of Symbol specific parameters. </p> <p>For example, to signify that the stock data for Sun Microsystems (JAVA) should be downloaded from Yahoo! Finance, one would call <code>setSymbolLookup(JAVA='yahoo')</code> or <code>setSymbolLookup(JAVA=list(src='yahoo'))</code> </p> <p>It is also possible to specify additional, possibly source specific, lookup details on a per symbol basis. These include an alternate naming convention (useful for sites like Yahoo! where certain non-traded symbols are prepended with a caret, or more correctly a curcumflex accent. In that case one would specify <code>setSymbolLookup(DJI=list(name="^DJI",src="yahoo"))</code>) as well as passed parameters like <code>dbname</code> and <code>password</code> for database sources. See the specific getSymbols function related to the source in question for more details of each implementation. </p> <p>If a single named list is passed into the function without naming the list as a parameter, the names of this list will be presumed to be symbol names to be added to the current list of symbols. </p> <p>All changes are made to the current list, and will persist <em>only</em> until the end of the session. To <em>always</em> use the same defaults it is necessary to call <code>setSymbolLookup</code> with the appropriate parameters from a startup file (e.g. .Rprofile) or to use <code>saveSymbolLookup</code> and <code>loadSymbolLookup</code> to save and restore lookup tables. </p> <p>To unset a specific Symbol's defaults, simply assign <code>NULL</code> to the Symbol. </p> <h3>Value</h3> <p>Called for its side effects, the function changes the <code>options</code> value for the specified Symbol through a call to <code>options(getSymbols.sources=...)</code> </p> <h3>Note</h3> <p>Changes are <em>NOT</em> persistent across sessions, as the table is stored in the session options by default. </p> <p>This <em>may</em> change to allow for an easier to manage process, as for now it is designed to minimize the clutter created during a typical session. </p> <h3>Author(s)</h3> <p> Jeffrey A. Ryan </p> <h3>See Also</h3> <p><code><a href="getSymbols.html">getSymbols</a></code>, <code><a href="../../base/html/options.html">options</a></code>,</p> <h3>Examples</h3> <pre> setSymbolLookup(QQQQ='yahoo',DIA='MySQL') getSymbolLookup('QQQQ') getSymbolLookup(c('QQQQ','DIA')) ## Not run: ## Will download QQQQ from yahoo ## and load DIA from MySQL getSymbols(c('QQQQ','DIA')) ## End(Not run) ## Use something like this to always retrieve ## from the same source .First <- function() { require(quantmod,quietly=TRUE) quantmod::setSymbolLookup(JAVA="MySQL") } ## OR ## Not run: saveSymbolLookup() loadSymbolLookup() ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>quantmod</em> version 0.4.20 <a href="00Index.html">Index</a>]</div> </body></html>