read_zipcode: Read Japan post's zip-code file

View source: R/zipcode.R

read_zipcodeR Documentation

Read Japan post's zip-code file

Description

\Sexpr[results=rd, stage=render]{lifecycle::badge("experimental")}

Usage

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"

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.

Value

tibble

See Also

https://www.post.japanpost.jp/zipcode/dl/readme.html, https://www.post.japanpost.jp/zipcode/dl/jigyosyo/readme.html

Examples

# Input sources
read_zipcode(path = system.file("zipcode_dummy/13TOKYO_oogaki.CSV", package = "zipangu"),
             type = "oogaki")
read_zipcode(system.file("zipcode_dummy/13TOKYO_kogaki.CSV", package = "zipangu"),
             "oogaki")
read_zipcode(system.file("zipcode_dummy/KEN_ALL_ROME.CSV", package = "zipangu"),
             "roman")
read_zipcode(system.file("zipcode_dummy/JIGYOSYO.CSV", package = "zipangu"),
             "jigyosyo")
## Not run: 
# Or directly from a URL
read_zipcode("https://www.post.japanpost.jp/zipcode/dl/jigyosyo/zip/jigyosyo.zip")

## End(Not run)

zipangu documentation built on Dec. 9, 2022, 9:07 a.m.