Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
library(ggplot2)
library(sf)
# Prepare layer
dat = data.frame(
name = c("Beer-Sheva Center", "Beer-Sheva University", "Dimona"),
lon = c(34.79844, 34.81283, 35.01163),
lat = c(31.24329, 31.26028, 31.06862)
)
dat = st_as_sf(dat, coords = c("lon", "lat"), crs = 4326)
# Plot
ggplot(data = dat) +
geom_sf() +
geom_sf_text(aes(label = name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment