cities <- data.frame(
x = c(-63.58595, 116.41214, 0),
y = c(44.64862, 40.19063, 89.9),
city = c("Halifax", "Beijing", "North Pole")
)
library(ggrepel)
ggplot(cities, aes(x, y)) +
geom_spatial_point(crs = 4326) +
stat_spatial_identity(aes(label = city), geom = "label_repel") +
coord_sf(crs = 3857)
Run the code above in your browser using DataLab