dlxGetData {Haver} | R Documentation

## Get Time Series from a Haver Database (legacy function / help entry)

### Description

Get one or more time series, convert them to the same frequency, and store them in a zoo object. Frequency aggregation is currently supported, but not disaggregation.

### Usage

    dlxGetData(varnames, database, start, end, frequency, .colnames)

### Arguments

`varnames` | A vector of Haver variable names. You can either give just the variable name, or a combination of the database name and variable name in the format "DATABASE:VARIABLE". If a database is not given, then the series will be assumed to reside in the database given in the function's database argument.
`database` | A Haver database name (with no file name extension). Each variable name that does not explicitly contain a database name will be assumed to reside in this database.
`start` | Optional starting date for the time series window, defined using either a Date object or something that can be coerced to a Date (such as a string, POSIXct, or chron object). Leave blank to start at the latest date that still captures all the series. If the provided starting date is earlier than the first value of any of the series in your query, than the zoo object will be padded with blank values.
`end` | Optional ending date for the time series window. defined using either a Date object or something that can be coerced to a Date (such as a string, POSIXct, or chron object). Leave blank to end at the earliest date which still captures all the series. If the provided ending date is later than the last value of any of the series in your query, than the zoo object will be padded with blank values.
`frequency` | Optional frequency that the time series should be converted to, IF POSSIBLE. Options are "d", "wmon", "wtue", "wwed", "wthu", "wfri", "wsat", "wsun", "m", "q", "a". If left blank, all series are converted to the frequency of the lowest-frequency series listed in varnames. For instance, if you pass in the names of monthly and quarterly series then the resulting block will come back as quarterly. The frequency option will have no effect if you specify a frequency that is higher than the lowest frequency series in your list of variables. For example, if you request a monthly and quarterly series and ask for monthly frequency then you will still get data in a quarterly frequency. On the other hand, if you asked for annual data, the resulting data would in fact be annual.
`.colnames` | Optional vector of column names to be used for the zoo object. Length must be equal to varnames. If no values are given, the zoo object will use lowercase Haver variable names.

### Value

A zoo object indexed by Date objects. The Date objects are set to the last day in each period.

### Examples

    ## Not run:
    ## Load Haver library
    library(Haver)

    ## Set the location of your Haver databases.
    dlxSetDbPath("C:/DLX/data/")

    ## Get the series LANAGRA and GDP from database USECON.
    dlxGetData(c("lanagra", "gdp"), "usecon")

    ## Get the series LANAGRA and GDP from database USECON and
    ## FFED from database WEEKLY
    dlxGetData(c("lanagra", "gdp", "weekly:ffed"), "usecon")

    ## Get the series LANAGRA from database USECON in the date range
    ## 2000:1 to 2010:12
    dlxGetData("lanagra", "usecon", start="2000-01-01", end="2010-12-31")

    ## Get the series LANAGRA from database USECON, convert to quarterly
    ## frequency, and get data in the range 2000:1 to 2010:4
    dlxGetData("lanagra", "usecon", start="2000-01-01", end="2010-12-31",
      frequency="q")

    ## End(Not run)

[Package Haver version 3.2 Index]