library(g2r)

The fig_map function will download the appropriate GeoJSON.

data("airports", package = "nycflights13")

airports %>% 
  dplyr::select(longitude = lon, latitude = lat) %>% 
  g2(asp(longitude, latitude)) %>% 
  fig_map(map = "usa", style(fill = "#d3d3d3")) %>% 
  fig_point(axes = FALSE) %>% 
  gauge_x_linear(min = -125, max = -66) %>% 
  gauge_y_linear(min = 24, max = 50)

Everytime you call fig_map the function downloads the map, may therefore want to use get_map to download the map just once then plot the map using fig_polygon, which is what fig_map does internally

world <- get_map() # no map name returns world map.

countries <- countrycode::codelist$country.name.en

countries <- dplyr::tibble(
  name = countries,
  value = runif(length(countries), 1, 100)
)  %>% 
  dplyr::mutate(
    name = dplyr::case_when(
      name == "United States" ~ "United States of America",
      TRUE ~ name
    )
  ) %>% 
  dplyr::left_join(world, by = "name") 

g2(asp(longitude, latitude, color = value), data = countries) %>% 
  fig_polygon(axes = FALSE, tooltip = FALSE) %>% 
  gauge_color(c("red", "white", "blue"))
data("airports", package = "nycflights13")

airports %>% 
  dplyr::filter(lon <= -50) %>% 
  g2(asp(lon, lat, color = "count"), height = 820) %>% 
  fig_bin(type = "hexagon", bins = c(70, 70), size_count = FALSE) %>% 
  gauge_color(c("red", "white", "blue")) %>% 
  hide_axes() %>% 
  motif(height = 820)