Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
R
 
 
img
 
 
man
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

czechrates

Travis build status Coveralls test coverage CRAN Downloads-total Downloads-weekly

The PRague InterBank Offered Rates (PRIBOR - the CZK member of the broader IBOR family) are provided by the Czech National Bank as a courtesy of the Czech Financial Benchmark Facility s.r.o., the benchmark administrator of the PRIBOR benchmark. The rates can be accessed for internal purposes free of charge via internet pages of ČNB – https://www.cnb.cz/en/financial-markets/money-market/pribor/format-of-the-pribor-rate-on-the-cnb-website/

The two-week repo rate (a key policy rate) is formally announced by ČNB and also published on the ČNB internet – https://www.cnb.cz/en/faq/How-has-the-CNB-two-week-repo-rate-changed-over-time/

The package {czechrates} provides a convenient way to access the information stored on the ČNB site from the comfort of your R session. It does not store the rates (this would be against the terms of use, and the data would get stale rather soon). As a consequence a working internet connection is required to use the package.


The package currently contains a two functions: czechrates::pribor() and czechrates::repo2w()

The pribor() function has two parameters:

  • date = date valid for the PRIBOR rate; default is yesterday (Sys.Date() - 1)

  • maturity = tenor of the PRIBOR rate; quoted as one of the standard maturities: 1D (overnight = default), 1W (weekly) and 1M, 2M, 3M, 6M, 9M and 1Y.

The repo2wr() function has only a single parameter (as the maturity is two weeks by definition):

  • date = date valid for the two-week repo rate; default is yesterday (Sys.Date() - 1)

Installation

czechrates is on CRAN since June 2020; to install a stable version run:

install.packages("czechrates")

You are welcome to install the latest development version from GitHub by running:

remotes::install_github("jla-data/czechrates")

Example

A simple example:

library(czechrates)

pribor() # overnight PRIBOR for yesterday
# A tibble: 1 x 2
  date_valid PRIBOR_1D
  <date>         <dbl>
1 2020-05-26    0.0025

pribor(as.Date("2020-04-01")) # overnight PRIBOR for April 1st, 2020
# A tibble: 1 x 2
  date_valid PRIBOR_1D
  <date>         <dbl>
1 2020-04-01    0.0101

pribor(as.Date("2020-04-01"), c("1W", "1M")) # weekly and monthly PRIBOR for April 1st, 2020
# A tibble: 1 x 3
  date_valid PRIBOR_1W PRIBOR_1M
  <date>         <dbl>     <dbl>
1 2020-04-01    0.0102    0.0104

repo2w() # two-week REPO rate for yesterday
# A tibble: 1 x 2
  date_valid REPO_2W
  <date>       <dbl>
1 2020-05-26  0.0025

repo2w(as.Date("2020-04-01")) # two-week repo rate for April 1st, 2020
# A tibble: 1 x 2
  date_valid REPO_2W
  <date>       <dbl>
1 2020-04-01    0.01

A graphic example:

library(czechrates)
library(ggplot2)

chart_src <- pribor(seq(from = as.Date("1997-05-01"), 
                        to = as.Date("1997-06-30"),
                        by = 1))

ggplot(data = chart_src, aes(x = date_valid, y = PRIBOR_1D)) +
  geom_line(color = "red", size = 1.25) +
  geom_point(color = "red", size = 2) +
  scale_x_date(date_labels = "%d.%m.%Y") +
  scale_y_continuous(labels = scales::percent_format()) +
  theme_bw() +
  labs(title = "A ghost of the times past, when the Asian Fever meant *monetary* contagion...",
       x = "Date",
       y = "Overnight PRIBOR (per annum)") +
  theme(plot.title = ggtext::element_markdown(size = 22))

Asian Fever, version 1997

About

A package providing Czech benchmark interest rates in R friendly format for analysis and visualization

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.