-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
67 lines (50 loc) · 1.97 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# nationwider <a href='https://kvasilopoulos.github.io/nationwider'><img src='man/figures/logo.png' align="right" height="138" /></a>
<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/nationwider)](https://CRAN.R-project.org/package=nationwider)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![Codecov test coverage](https://codecov.io/gh/kvasilopoulos/nationwider/branch/master/graph/badge.svg)](https://codecov.io/gh/kvasilopoulos/nationwider?branch=master)
[![R-CMD-check](https://github.com/kvasilopoulos/nationwider/workflows/R-CMD-check/badge.svg)](https://github.com/kvasilopoulos/nationwider/actions)
<!-- badges: end -->
The goal of {nationwider} is to provide house price data from [<nationwide.co.uk>](https://www.nationwide.co.uk/). All datasets available have
been curated using tidytools and returned in a convenient rectangular tidy format.
## Installation
You can install the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("kvasilopoulos/nationwider")
```
## Example
This is a basic example on how to download data with {nationwider}.
```{r example}
library(nationwider)
np <- nationwider::ntwd_get("new_prop")
np
```
We reshape our data from the initial form into a wider form.
```{r wrangling}
library(dplyr)
library(tidyr)
np %>%
dplyr::filter(type == "Price") %>%
spread(region,value)
```
Here we are plotting all regions using type `Index` and `Price` as facets.
```{r plotting, warning=FALSE}
library(ggplot2)
np %>%
ggplot(aes(Date, value, col = region)) +
geom_line() +
facet_wrap(~ type, scales = "free")
```