getSeries {bundesbank}R Documentation

Download Time-Series Data from Bundesbank

Description

Download time-series from the website of the Bundesbank.

Usage

getSeries(series,
          start = NULL,
          end = format(Sys.Date(), "%Y-%m"),
          return.class = "data.frame",
          verbose = TRUE, dest.dir = NULL)

Arguments

series

The series name as given by the Bundesbank (e.g. ‘BBK01.ST0316’ for 3-Month EURIBOR).

start

character in format ‘YYYY-MM’ or ‘YYYY’. If omitted, the function downloads data from the earliest available date. Currently ignored for real-time datasets.

end

character in format ‘YYYY.MM’ or ‘YYYY’. If omitted, the function downloads data up to the most recent available date. Currently ignored for real-time datasets.

return.class

character or NULL. Currently supported are "zoo" and "data.frame". If NULL or "list", a list is returned for time-series. Real-time data are always returned as a data.frame.

verbose

logical

dest.dir

NULL or character. If character, it must be the path to an existing directory. See Details.

Details

The data can be downloaded in CSV-format from the Bundesbank's website http://www.bundesbank.de .

If dest.dir is provided, the downloaded dataset gets a date prefix (today in format YYYYMMDD) and is stored in directory dest.dir. Before any download is attempted, the function checks whether a file with today's prefix exist in dest.dir; if yes, the file is used.

Value

A data.frame with two (or more) columns:

dates

dates (of class Date)

values

numerical values

The result for single time-series may have an attribute info, which is a character vector and holds additional information for series (such as its unit). See Examples.

Real-time datasets are always organised as a data.frame, in which the rows correspond to the reporting period and the columns to the publication date. Real-time datasets always have several attributes, in particular date, which corresponds to the publication date.

Author(s)

Maintainer: Enrico Schumann <es@enricoschumann.net>

Examples


## (Internet connection required)
  
series <- "BBK01.ST0304" ## Eonia
res <- getSeries(series) ## retrieve all available data
res <- getSeries(series, start = "2012-01")
res <- getSeries(series, end   = "2012-01")
res <- getSeries(series, start = "2012-01", end = "2012-05")

## make 'zoo' series
if (require("zoo")) {
    Eonia <- zoo(res$values, res$dates)
    plot(Eonia)
}

## check comments
writeLines(strwrap(paste("- ", attr(res, "info")), width = 60, exdent = 2))

## real-time dataset (Gross domestic product)
gdp <- getSeries("BBKRT.A.DE.N.A.AG1.CA010.V.A")

## use caching
## ==> the example uses a temporary directory, but
##     better is to use a less ephemeral destination,
##     e.g. '~/Downloads/bundesbank'
gdp <- getSeries("BBKRT.A.DE.N.A.AG1.CA010.V.A",
                 dest.dir = tempdir())
### Downloading data from Bundesbank ... Done.

gdp <- getSeries("BBKRT.A.DE.N.A.AG1.CA010.V.A",
                 dest.dir = tempdir())
### Using cache ... Done.


[Package bundesbank version 0.1-9 Index]