[Experimental]

read_zipcode(path, type = c("oogaki", "kogaki", "roman", "jigyosyo"))

Arguments

path

local file path or zip file URL

type

Input file type, one of "oogaki", "kogaki", "roman", "jigyosyo"

Value

tibble

Details

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.

See also

Examples

# Input sources read_zipcode(path = system.file("zipcode_dummy/13TOKYO_oogaki.CSV", package = "zipangu"), type = "oogaki")
#> # A tibble: 1 x 15 #> jis_code old_zip_code zip_code prefecture_kana city_kana street_kana #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 13101 100 1000001 トウキヨウト チヨダク チヨダ #> # … with 9 more variables: prefecture <chr>, city <chr>, street <chr>, #> # is_street_duplicate <dbl>, is_banchi <dbl>, is_cyoumoku <dbl>, #> # is_zipcode_duplicate <dbl>, status <dbl>, modify_type <dbl>
read_zipcode(system.file("zipcode_dummy/13TOKYO_kogaki.CSV", package = "zipangu"), "oogaki")
#> # A tibble: 1 x 15 #> jis_code old_zip_code zip_code prefecture_kana city_kana street_kana #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 13101 100 1000001 トウキヨウト チヨダク チヨダ #> # … with 9 more variables: prefecture <chr>, city <chr>, street <chr>, #> # is_street_duplicate <dbl>, is_banchi <dbl>, is_cyoumoku <dbl>, #> # is_zipcode_duplicate <dbl>, status <dbl>, modify_type <dbl>
read_zipcode(system.file("zipcode_dummy/KEN_ALL_ROME.CSV", package = "zipangu"), "roman")
#> # A tibble: 1 x 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 x 13 #> jis_code name_kana name prefecture city street street_sub jigyosyo_identi… #> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 13101 ニツポンユウビン カ… 日本郵便… 東京都 千代田区… 大手町 2−3−1 1008792 #> # … with 5 more variables: old_zip_code <chr>, grouped <chr>, #> # individual_id <int>, multiple_type <int>, update_type <int>
if (FALSE) { # Or directly from a URL read_zipcode("https://www.post.japanpost.jp/zipcode/dl/jigyosyo/zip/jigyosyo.zip") }