Skip to contents

extract_fude() extracts the specified data from the list returned by read_fude().

Usage

extract_fude(data, year = NULL, city = NULL, list = TRUE)

Arguments

data

List of sf::sf() objects.

year

Year to be extracted. If both year and city are not specified, all objects for the most recent year are extracted.

city

Local government name (or code) to be extracted.

list

logical. If FALSE, the object to be extracted is no longer a list.

Value

A list of sf::sf() object(s).

See also

Examples

path <- system.file("extdata", "castle.zip", package = "fude")
d <- read_fude(path, quiet = TRUE)
d2 <- extract_fude(d, year = 2022, city = "\u677e\u5c71\u5e02")
d |> extract_fude(year = 2022)
#> $`2022_382019`
#> Simple feature collection with 1 feature and 6 fields
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 132.7653 ymin: 33.84506 xmax: 132.7662 ymax: 33.84575
#> Geodetic CRS:  WGS 84
#>   X_color X_opacity X_weight X_fillColor X_fillOpacity local_government_cd
#> 1 #000000       0.5        3     #ff0000           0.5              382019
#>                         geometry
#> 1 POLYGON ((132.7653 33.84575...
#> 
#> $`2022_382078`
#> Simple feature collection with 1 feature and 6 fields
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 132.541 ymin: 33.50931 xmax: 132.5415 ymax: 33.50966
#> Geodetic CRS:  WGS 84
#>   X_color X_opacity X_weight X_fillColor X_fillOpacity local_government_cd
#> 1 #000000       0.5        3     #ff0000           0.5              382078
#>                         geometry
#> 1 POLYGON ((132.541 33.50966,...
#>