Skip to contents

extract_boundary() extracts subsets of agricultural community boundary data returned by get_boundary() by municipality, former municipality, and/or agricultural community.

Usage

extract_boundary(boundary, city = "", kcity = "", rcom = "", layer = FALSE)

Arguments

boundary

Boundary data returned by get_boundary(), or an sf::sf() object or list of such objects with ten-character region keys.

city

A character vector of municipality names or local government codes used to identify target municipalities. If NULL, all municipalities are kept.

kcity

A character vector of regular expression patterns used to match former municipality names in Japanese.

rcom

A character vector of regular expression patterns used to match agricultural community names in Japanese.

layer

Logical. If TRUE, return a list containing extracted agricultural community boundaries together with former municipality, municipality, and prefecture boundary layers.

Value

If layer = FALSE, an sf::sf() object. If layer = TRUE, a named list of sf::sf() objects.

Details

Names are matched using the agricultural community reference year (rcom_year) recorded in boundary. Use boundaries from a single reference year. If no reference year is recorded, the 2020 lookup is used for compatibility. With no search criteria, all supplied boundaries are returned. For filtered searches, a coarser boundary can match when its region has no finer boundaries in the input. Aggregated layers retain a recorded year when the contributing features agree on it.

See also