Skip to content

Instantly share code, notes, and snippets.

@ito4303
Last active September 10, 2018 12:45
Show Gist options
  • Save ito4303/7d527ba01355f5e13523e916125d5005 to your computer and use it in GitHub Desktop.
Save ito4303/7d527ba01355f5e13523e916125d5005 to your computer and use it in GitHub Desktop.
library(sf)
library(jpndistrict)
library(stringr)
library(ggplot2)
# 札幌市
sapporo <- jpn_cities(jis_code = sprintf("%05d", 1101:1110))
ggplot(sapporo) +
geom_sf(aes(fill = city_code)) +
scale_fill_discrete(name = "区",
labels = str_remove(sapporo$city, "札幌市 ")) +
theme_bw(base_family = "IPAexGothic")
# 函館市
hakodate <- jpn_cities(jis_code = "01202")
ggplot(hakodate) +
geom_sf(aes(fill = city)) +
theme_bw(base_family = "IPAexGothic")
# 大垣市
oogaki <- jpn_cities(jis_code = "21202")
ggplot(oogaki) +
geom_sf(fill = "green")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment