Я не уверен на 100%, что понимаю ваши вопросы, но вы хотите создать что-то подобное?
# packages
library(sf)
#> Linking to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3
library(magrittr)
library(tmap)
# points data
col_coor <- data.frame(
SUB = c(
"mandtii", "ultimus", "ultimus", "arcticus", "arcticus", "arcticus",
"arcticus", "arcticus", "arcticus", "islandicus", "grylle"
),
POP = c("AK", "NU", "GR", "LB", "NF", "ST", "NS", "NB", "ME", "IC", "FI"),
LON = c(-156, -82.5, -70.2, -61.7, -53.6, -69.7, -61.5, -66.8, -68.2, -22.9, 19.3),
LAT = c(71.2, 65.9, 76.5, 56.6, 47.3, 47.8, 45.1, 44.6, 44.2, 65.4, 60.2),
stringsAsFactors = FALSE
)
new_crs <- "+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs"
col_coor <- col_coor %>%
st_as_sf(coords = c("LON", "LAT"), crs = 4326) %>%
st_transform(crs = new_crs)
# world data
data("wrld_simpl", package = "maptools")
wrld_simpl <- st_as_sf(wrld_simpl) %>%
st_crop(xmin = -180, xmax = 180, ymin = 35, ymax = 90) %>%
st_transform(crs = new_crs)
#> although coordinates are longitude/latitude, st_intersection assumes that they are planar
#> Warning: attribute variables are assumed to be spatially constant throughout all
#> geometries
# plot
tm_shape(wrld_simpl) +
tm_polygons() +
tm_shape(col_coor) +
tm_dots(col = "POP", size = 0.33) +
tm_layout(legend.outside = TRUE, legend.text.size = 1.25, legend.title.size = 1.25)
#> Warning: The shape wrld_simpl is invalid. See sf::st_is_valid
Создано в 2020-02-14 пакетом Представить (v0.3.0)
Вы можете прочитать более подробную информацию о tmap здесь: https://geocompr.robinlovelace.net/adv-map.html