urbnmapr to get a county base map. I want to plot my own points on top of this map. Even though the
urbnmapr map plots with lat/long on the x y axis, the lat/long points that I want to plot over it do not. Why is this and how can I fix it?
library(tidyverse) library(sf) #devtools::install_github("UrbanInstitute/urbnmapr") library(urbnmapr) counties_sf <- get_urbn_map(map = "counties", sf = TRUE,) %>% subset(state_abbv %in% "SC") points <- tibble(x = c(34.95116, 34.95265, 34.95116, 35.07469), y = c(-82.79619 , -82.79647, -82.79676, -82.63421)) %>% st_as_sf(coords = c("x", "y"), crs = st_crs(counties_sf)) ggplot()+ geom_sf(data = counties_sf)+ geom_sf(data = points)
Here the map of SC is in the right position, but the points are not. Examining the
counties_sf data, I see their geometry is wacky, while the
points geometry is not. I'm very confused...