read_zipcode(path, type = c("oogaki", "kogaki", "roman", "jigyosyo"))
local file path or zip file URL
Input file type, one of "oogaki", "kogaki", "roman", "jigyosyo"
Reads zip-code data in csv format provided by japan post group and parse it as a data.frame. Corresponds to the available "oogaki", "kogaki", "roman" and "jigyosyo" types. These file types must be specified by the argument.
# Input sources
read_zipcode(path = system.file("zipcode_dummy/13TOKYO_oogaki.CSV", package = "zipangu"),
type = "oogaki")
#> # A tibble: 1 × 15
#> jis_code old_zi…¹ zip_c…² prefe…³ city_…⁴ stree…⁵ prefe…⁶ city street is_st…⁷
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <dbl>
#> 1 13101 100 1000001 トウキ… チヨダ… チヨダ 東京都 千代… 千代田 0
#> # … with 5 more variables: is_banchi <dbl>, is_cyoumoku <dbl>,
#> # is_zipcode_duplicate <dbl>, status <dbl>, modify_type <dbl>, and
#> # abbreviated variable names ¹old_zip_code, ²zip_code, ³prefecture_kana,
#> # ⁴city_kana, ⁵street_kana, ⁶prefecture, ⁷is_street_duplicate
read_zipcode(system.file("zipcode_dummy/13TOKYO_kogaki.CSV", package = "zipangu"),
"oogaki")
#> # A tibble: 1 × 15
#> jis_code old_zi…¹ zip_c…² prefe…³ city_…⁴ stree…⁵ prefe…⁶ city street is_st…⁷
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <dbl>
#> 1 13101 100 1000001 トウキ… チヨダ… チヨダ 東京都 千代… 千代田 0
#> # … with 5 more variables: is_banchi <dbl>, is_cyoumoku <dbl>,
#> # is_zipcode_duplicate <dbl>, status <dbl>, modify_type <dbl>, and
#> # abbreviated variable names ¹old_zip_code, ²zip_code, ³prefecture_kana,
#> # ⁴city_kana, ⁵street_kana, ⁶prefecture, ⁷is_street_duplicate
read_zipcode(system.file("zipcode_dummy/KEN_ALL_ROME.CSV", package = "zipangu"),
"roman")
#> # A tibble: 1 × 7
#> zip_code prefecture city street prefecture_roman city_roman street_roman
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 1000001 東京都 千代田区 千代田 Tokyo To Chiyoda Ku Chiyoda
read_zipcode(system.file("zipcode_dummy/JIGYOSYO.CSV", package = "zipangu"),
"jigyosyo")
#> # A tibble: 1 × 13
#> jis_code name_kana name prefec…¹ city street stree…² jigyo…³ old_z…⁴ grouped
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 13101 ニツポン… 日本… 東京都 千代… 大手町 2-3-1 1008792 100 銀座
#> # … with 3 more variables: individual_id <int>, multiple_type <int>,
#> # update_type <int>, and abbreviated variable names ¹prefecture, ²street_sub,
#> # ³jigyosyo_identifier, ⁴old_zip_code
if (FALSE) {
# Or directly from a URL
read_zipcode("https://www.post.japanpost.jp/zipcode/dl/jigyosyo/zip/jigyosyo.zip")
}