Skip to contents

Import hex map coordinates

Usage

get_coordinates(map = NULL, coords = "hexmap")

Arguments

map

A character string specifying which map. Current options are "usa50" (50 US States only), "usa51" (50 states and DC), "usa52" (50 states, DC, and Puerto Rico), "usa53" (50 states, DC, PUerto Rico and Virgin Islands), "usa56" (50 states, DC, territories (PR, VI, AS, GU, MP)), "usa56" (50 states, DC, territories (PR, VI, AS, GU, MP), and freely associate states (FM, MH, PW)), "usaETA" (US DOL ETA geographies, same as usa56 with the addition of the freely associate state of Palau), and "usaETARegions" (unified maps of US DOL ETA regions) .

coords

A character string specifying "hexmap" for the hexagon coordinates or "labels" for the label coordinates for the hex map

Value

sf object for map, either the hexagons (polygon) or labels (point).

Examples

get_coordinates(map = "usa50", coords = "hexmap")
#> Simple feature collection with 50 features and 8 fields
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 0.8845727 ymin: -250 xmax: 433.8973 ymax: 0
#> CRS:           NA
#> # A tibble: 50 × 9
#>    abbr_usps abbr_gpo abbr_ap abbr_short abbr_long name        fips  geo_type
#>    <fct>     <fct>    <fct>   <chr>      <chr>     <fct>       <chr> <fct>   
#>  1 AL        Ala.     Ala.    Ala.       Alab.     Alabama     01    state   
#>  2 AK        Alaska   Alaska  Ak.        Alaska    Alaska      02    state   
#>  3 AZ        Ariz.    Ariz.   Arz.       Ariz.     Arizona     04    state   
#>  4 AR        Ark.     Ark.    Ark.       Arkan.    Arkansas    05    state   
#>  5 CA        Calif.   Calif.  Cal.       Calif.    California  06    state   
#>  6 CO        Colo.    Colo.   Col.       Colo.     Colorado    08    state   
#>  7 CT        Conn.    Conn.   Con.       Conn.     Connecticut 09    state   
#>  8 DE        Del.     Del.    Del.       Dela.     Delaware    10    state   
#>  9 FL        Fla.     Fla.    Fla.       Flor.     Florida     12    state   
#> 10 GA        Ga.      Ga.     Ga.        Georg.    Georgia     13    state   
#> # ℹ 40 more rows
#> # ℹ 1 more variable: geometry <POLYGON>
get_coordinates(map = "usa50", coords = "labels")
#> Simple feature collection with 50 features and 8 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 18.20508 ymin: -230 xmax: 416.5768 ymax: -20
#> CRS:           NA
#> # A tibble: 50 × 9
#>    abbr_usps abbr_gpo abbr_ap abbr_short abbr_long name        fips  geo_type
#>  * <fct>     <fct>    <fct>   <chr>      <chr>     <fct>       <chr> <fct>   
#>  1 AL        Ala.     Ala.    Ala.       Alab.     Alabama     01    state   
#>  2 AK        Alaska   Alaska  Ak.        Alaska    Alaska      02    state   
#>  3 AZ        Ariz.    Ariz.   Arz.       Ariz.     Arizona     04    state   
#>  4 AR        Ark.     Ark.    Ark.       Arkan.    Arkansas    05    state   
#>  5 CA        Calif.   Calif.  Cal.       Calif.    California  06    state   
#>  6 CO        Colo.    Colo.   Col.       Colo.     Colorado    08    state   
#>  7 CT        Conn.    Conn.   Con.       Conn.     Connecticut 09    state   
#>  8 DE        Del.     Del.    Del.       Dela.     Delaware    10    state   
#>  9 FL        Fla.     Fla.    Fla.       Flor.     Florida     12    state   
#> 10 GA        Ga.      Ga.     Ga.        Georg.    Georgia     13    state   
#> # ℹ 40 more rows
#> # ℹ 1 more variable: geometry <POINT>