get_boundary: Get agricultural community boundary data

View source: R/get_boundary.R

get_boundaryR Documentation

Get agricultural community boundary data

Description

get_boundary() downloads and reads one or more MAFF agricultural community boundary datasets and returns them as a named list of sf::sf() objects. The target prefectures are determined from data.

Usage

get_boundary(
  data,
  boundary_data_year = 2020,
  rcom_year = 2020,
  boundary_type = 1,
  path = NULL,
  suffix = FALSE,
  crs = NULL,
  encoding = "CP932",
  quiet = FALSE
)

Arguments

data

Either a Fude Polygon data object returned by read_fude(), or a prefecture code or Japanese prefecture name.

boundary_data_year

The year of the boundary dataset.

rcom_year

The agricultural community reference year used in the MAFF file name.

boundary_type

Integer specifying the boundary level to read: 1 for agricultural community, 2 for former municipality, and 3 for municipality.

path

Path to a directory containing boundary ZIP files. If NULL, ZIP files are downloaded automatically.

suffix

Logical. If FALSE, suffixes are removed from romaji municipality names, such as "-shi" and "-ku".

crs

Coordinate reference system to transform the output data to. If NULL, the source CRS is kept.

encoding

Character encoding of the source shapefile attributes, such as "CP932".

quiet

Logical. If TRUE, suppress messages during download and reading.

Value

A named list of sf::sf() objects.

Examples


path <- system.file("extdata", "castle.zip", package = "fude")
d <- read_fude(path)
b <- get_boundary(d)


fude documentation built on April 5, 2026, 9:06 a.m.