TSget {TSdbi}R Documentation

Get Time Series Data Using a Database Connection

Description

Get time series matrix structure from a database

Usage

    TSget(serIDs, con=getOption("TSconnection"),  ...)
    ## S4 method for signature 'character, missing':
    TSget(serIDs, con=getOption("TSconnection"),  ...)
    ## S4 method for signature 'character, ANY':
    TSget(serIDs, con=getOption("TSconnection"),  ...)

Arguments

con A database connection.
serIDs identifiers for series to extract.
... Arguments passed to TSgetSQL or other methods.

Details

These functions extract data from a database using a connection. This method is generic. The argument serIDs should give identifiers for the series to extract.

TSget and other functions also provide a way to query a regularly used database by setting the connection in options using options(TSconnection=con), so then only the series identifiers need to be specified in calls to TSget.

The user can specify a default time series representation with the argument TSrepresentation="something" where "something" is "default" by default, but might be "zoo" or something else which is used to coerce the representation. The TSrepresentation is passed in the ... argument. The representation is applied using do.call(TSrepresentation, list(mat)) where mat is the time series (matrix) to be return. If TSrepresentation is not specified then the ts representation is used for data from tables "A", "Q", "M","S" and zoo otherwise. See TSput for a list of the various tables.

It would be possible to specify TSrepresentation="as.zoo", but this may result in as.zoo being applied twice, in which case some information abut the time representation gets lost, so the best way to get a zoo represenation is to specify TSrepresentation="zoo".

Users can set a session default with options(TSrepresentation="something") so that this is always passed as an argument to TSget.

It is also possible to pass start, end, or tframe information to truncate the returned series. This is part of the ... argument passed to tfwindow. Seetfwindow for more details. By default no truncation is applied.

If the database supports vintages or panels then it is also possible to set defaults for these with, for example, options(TSvintage="current") and options(TSpanel="Canada"). The default specification has to be supported by the database for this to work.

names, TSdescription, TSdoc andTSlabel can also be specified as arguments. (Passed in ...). See TSputSQL for more details.

Value

A time series matrix.

See Also

TSdbi-package, TSconnect, TSput, TSdates tfwindow


[Package TSdbi version 2009.1-1 Index]