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

kiaora

The goal of kiaora is to provide functions to get Auckland transport information and residential auction results for NZ property, including property information,auction price and dates, rating value and dates.

Installation

You can install the released version of kiaora from CRAN with:

install.packages("kiaora")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("Tina-ye112/kiaora")

Usage

This function contains 3 parameters that are region, district, area.You could input the region for the place that you are interested in, and the function would return a tibble with auction property price and other basic information. Or leave the parameters to be NULL, the function would return all auction results by default.

Here is an example for auction results of Northland region.

library(kiaora)
library(dplyr)
library(stringr)
library(lubridate)
get_property_auction_price(region = "Northland",district = NULL,area = NULL)

Here is the line graph illustrates the number of auction properties sold for New Zealand over months from 2018 to early in 2021.

library(ggplot2)
dataset <- nzhousingprice %>%
  mutate(
    group = ifelse(region == "Auckland", region, "Others"),
    auction_yrmth = zoo::as.yearmon(auction_dates)
  )
dataset_month <- dataset %>%
  mutate(
    month = month(auction_dates, label = TRUE),
    year = as.factor(year(auction_dates))) %>%
  group_by(month, year) %>%
  summarise(counts = n())
ggplot(dataset_month, aes(month, counts, group = year, colour = year)) +
  geom_line(size = 1) +
  geom_point() +
  labs(x = "Month", colour = "Year") +
  theme(legend.position = "top") 


Tina-ye112/kiaora documentation built on Feb. 25, 2021, 2:03 p.m.