Description Usage Arguments Details Value See Also Examples
Get a time series (matrix) using getSymbols from package quantmod, for example, from the Federal Reserve FRED database.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | getSymbol(...)
## S4 method for signature 'getSymbolConnection,missing'
TSconnect(
q, dbname, user="", password = "", host="", ...)
## S4 method for signature 'character,TSgetSymbolConnection'
TSget(
serIDs, con, TSrepresentation = options()$TSrepresentation,
tf = NULL, start = tfstart(tf), end = tfend(tf), names=serIDs,
quote = NULL, quiet = TRUE, repeat.try=3, ...)
## S4 method for signature 'character,TSgetSymbolConnection'
TSdates(
serIDs, con, vintage=NULL, panel=NULL, ... )
## S4 method for signature 'character,TSgetSymbolConnection'
TSdescription(x, con, ... )
## S4 method for signature 'character,TSgetSymbolConnection'
TSdoc(x, con, ... )
## S4 method for signature 'character,TSgetSymbolConnection'
TSlabel(x, con, ... )
## S4 method for signature 'character,TSgetSymbolConnection'
TSsource(x, con, ... )
|
q |
A character string indicating the query interface to use, or a database connection object. |
dbname |
The name of the database to which the connection should be
established, omitted if |
con |
a database connection object. |
serIDs |
identifiers for series on the database. |
vintage |
character string indicating vintage of the series on the database (not supported by this database). |
panel |
character string indicating panel of the series on the database (not supported by this database). |
x |
time series data(TSput), or identifiers for series on the database (TSdoc and TSdescription). |
names |
optional character vector to use for series names in the R object. |
tf |
time frame for trimming data, passed to tfwindow. |
start |
time frame for trimming data, passed to tfwindow. |
end |
time frame for trimming data, passed to tfwindow. |
TSrepresentation |
time representation for returned series.
(See |
quote |
reference item (e.g. ”Close”). See details. |
quiet |
logical to suppress progress report. |
repeat.try |
integer number of times to attempt retrieval before giving up. |
user |
(unused) a character string indicating a user id. |
password |
(unused) a character string indicating a password. |
host |
(unused) a character string indicating a host computer. |
... |
Arguments passed to methods or to
|
These functions interface to web database (e.g. FRED) using getSymbols
from the quantmod package.
TSget
is just a wrapper to getSymbols
.
No extra functionality is provided, only an interface that is consistent
with TSdbi. The TSdbi function argument serId
is passed
as the series to return,
dbname
is mapped to getSymbols
argument src
, and
TSrepresentation
to return.class
. The getSymbols
argument auto.assign
is set to FALSE
and the series is
returned for assignment by the user, as with other TSget
database interfaces. (See TSget
in TSdbi for
more details on how this works.)
The argument quote
with default NULL
, is provided to allow
automatically extracting part of the multivariate series returned by
getSymbols
. It can be set to any of "Open", "High", "Low",
"Close", "Volume", "Adjusted"
. If it is set to NULL
then all
will be returned.
TSgetSymbol does not support writing data to the source.
The classes getSymbolDriver
and TSgetSymbolConnection
extend classes
DBIDriver
and DBIConnection
in the DBI package.
See the package vignette for additional examples.
Depends.
TSdates
,
TSget
,
getSymbols
tfwindow
,
1 2 3 4 5 | require("tfplot")
con <- TSconnect("getSymbol", dbname="FRED")
x <- TSget("CPIAUCNS", con)
tfplot(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.