Description Usage Format Examples
A Choropleth Class for Osaka City Map
1 2 3 4 | osakaCityChoropleth
osaka_city_chropleth(df, title = "", legend = "", num_colors = 7,
zoom = NULL)
|
1 2 | Class 'R6ClassGenerator' <environment: 0x000000000a16be90>
- attr(*, "name")= chr "osakaCityChoropleth_generator"
|
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.