osakaCityChoropleth: A Choropleth Class for Osaka City Map

Description Usage Format Examples

Description

A Choropleth Class for Osaka City Map

Usage

1
2
3
4
osakaCityChoropleth

osaka_city_chropleth(df, title = "", legend = "", num_colors = 7,
  zoom = NULL)

Format

1
2
Class 'R6ClassGenerator' <environment: 0x000000000a16be90> 
 - attr(*, "name")= chr "osakaCityChoropleth_generator"

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
library(ggplot2)
library(dplyr)

csv_file <- tempfile(fileext = ".csv")
download.file("https://raw.githubusercontent.com/yutannihilation/osaka_age_composition/master/osaka_age_composition.csv",
           destfile = csv_file, method = "curl")

age_comp.df <- read.csv(csv_file, header = TRUE, stringsAsFactors = FALSE, fileEncoding = "UTF-8") %>%
  group_by(district) %>%
  summarise(value = sum(age * total)/sum(total)) %>%
  mutate(region = to_osaka_ward_code(district))

osaka_city_chropleth(age_comp.df, title = "Age Composition") + coord_equal()

## End(Not run)

yutannihilation/choroplethrOsakaCity documentation built on May 4, 2019, 7:45 p.m.