TSquery {TSdbi} | R Documentation |
Construct a time series from a database
TSquery(select, dateField, table, where=NULL, frequency="monthly", na.as=0, names=NULL, con=options()$connection)
select |
character string used to construct query. |
dateField |
character string used to construct query. |
table |
character string used to construct query. |
where |
character string used to construct query. |
frequency |
character string used to specify frequency of the result (only "daily", "monthly" or "annual" are currently supported. |
na.as |
value to be used to replace NA s in the returned series. |
names |
optional vector of character strings to be used for the
returned series. If not NULL it must have length equal to
the number of series returned. |
con |
A database connection. |
This functions is unlike other functins in this package (and may eventually be
moved to a separate package).
It constructs a time series from a database (using a connection) and a query
generated with the function arguments. An example query might be something like
z<- TSquery(select="SUM(amount )", dateField="issue_date", table="term",
where="term > 10", frequency="annual", con=con)
A time series or time series matrix.