knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  fig.width=6, 
  fig.height=7
)

ihpdr

CRAN status Lifecycle: stable R-CMD-check Codecov test coverage

The goal of {ihpdr} is to fetch data from the International House Price Database, compiled by the Federal Reserve Bank of Dallas.

Installation

You can install the released version of {ihpdr} from CRAN with:

install.packages("ihpdr")

Or install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("kvasilopoulos/ihpdr")

Example

This is a basic example which shows you how to download the data:

# Raw Data
ihpdr::ihpd_get()

# Exuberance Indicators ~ bsadf
ihpdr::ihpd_get("bsadf")

# Get the release dates
ihpdr::ihpd_release_dates()

Wrangle & Plot Real House Prices

library(tidyverse)

Raw Data

raw_data <- ihpdr::ihpd_get()

ggplot(raw_data, aes(Date, rhpi)) + 
  geom_line(size = 0.7) + 
  scale_x_date(date_labels = "%y") +
  facet_wrap(~country, ncol = 4) 

Exuberance Indicators - Date-stamping

bsadf_data <- ihpdr::ihpd_get("bsadf")

bsadf_data %>% 
  dplyr::filter(type == "rhpi", lag == 1) %>% 
  ggplot() + 
  geom_line(aes(Date, value), size = 0.7) +
  geom_line(aes(Date, crit), col = "red", size = 0.7) +
  scale_x_date(date_labels = "%y") +
  facet_wrap(~country, ncol = 4) +
  theme_bw()


kvasilopoulos/ihpdr documentation built on Jan. 21, 2021, 7:52 a.m.