Skip to contents
library(AOI)
library(mapview)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

AOI aims to provide a consistent, and flexible, syntax for retrieving fiat boundaries for spatial analysis, map making, and data retrivial. This is all done in the aoi_get function:

Definition: fiat: fiatness implies mind-dependence, and thus a fiat boundary is a boundary that is determined by human fiat, lacking any natural indication.

This package makes no claims on sovereignty and returns data as found in Natural Earth, or, produced by the US Census Department (in the US).

Countries

To retrive country boundaries (1 or more), ISO codes, abbreviations and names can be used:

am = aoi_get(country = "New Zealand") |> 
  plot(max.plot = 1)


aoi_get(country = c("484", "USA", "CA")) |> 
  plot(max.plot = 1)

State

aoi_get(state = "CO") |> 
  plot(max.plot = 1)


aoi_get(state = c("CO", "Utah")) |> 
  plot(max.plot = 1)

County

aoi_get(state = "CO", county = "Larimer") |> 
  plot(max.plot = 1)


aoi_get(state = "TX", county = "all") |> 
  plot(max.plot = 1)

FIP

aoi_get(fip = "01")  |> 
  plot(max.plot = 1)


aoi_get(fip = "01125")  |> 
  plot(max.plot = 1)

Zipcode

aoi_get(zipcode = "80906") |> 
  plot(max.plot = 1)
#> [1] "80906"
#>       zipcode      lat       lon
#> 28229   80906 38.76568 -104.8716

Aggregate

aoi_get(country = "Asia") |> 
  plot(max.plot = 1)


aoi_get(country = "Latin America & Caribbean") |> 
  plot(max.plot = 1)


aoi_get(state = "conus") |> 
  plot(max.plot = 1)


aoi_get(state = "south") |> 
  plot(max.plot = 1)

Union

aoi_get(country = "Latin America & Caribbean", union = TRUE) |> 
  plot()