You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting the following error when I try to use urbnmapr maps as sf objects.
"old-style crs object detected; please recreate object with a recent sf::st_crs()"
The code I used is
counties_sf <- get_urbn_map("counties", sf = TRUE)
counties_sf %>%
ggplot(aes()) +
geom_sf(fill = "grey", color = "#ffffff")
Is there an easy workaround or are there plans to update the map CRSs?
I was trying to bring the map is as an sf object so I could plot a scale bar and north arrow. I don't seem to be able to add those things using ggspatial which works with sf objects. See errors with code below:
Hi There -
I am getting the following error when I try to use urbnmapr maps as sf objects.
"old-style crs object detected; please recreate object with a recent sf::st_crs()"
The code I used is
counties_sf <- get_urbn_map("counties", sf = TRUE)
counties_sf %>%
ggplot(aes()) +
geom_sf(fill = "grey", color = "#ffffff")
Is there an easy workaround or are there plans to update the map CRSs?
I was trying to bring the map is as an sf object so I could plot a scale bar and north arrow. I don't seem to be able to add those things using ggspatial which works with sf objects. See errors with code below:
counties %>%
filter(state_name =="Florida") %>%
ggplot() +
geom_polygon( aes(long, lat, group = group),
color="black", fill = "gray80",size = 0.2) +
coord_map(projection = "albers", lat0 = 39, lat1 = 45)+
theme_map()+
theme(legend.position = c(0.1,0.6))+
ggspatial::annotation_scale(
location = "bl",
width_hint = 0.3,
height = unit(0.11, "cm"),
pad_x = unit(0.32, "in"),
pad_y = unit(0.15, "in"),
text_cex = 0.5,
text_pad = unit(0.05, "cm")
) +
ggspatial::annotation_north_arrow(
location = "bl",
which_north = "true",
pad_x = unit(0.27, "in"),
pad_y = unit(0.3, "in"),
height = unit(.8, "cm"),
width = unit(.8, "cm"),
style = north_arrow_fancy_orienteering
)
I am using RStudio 2023.06.0 Build 421
R version 4.3.1 "Beagle Scouts"
and urbnmapr 0.0.0.9002 that I installed 4 July 2023 from github
The text was updated successfully, but these errors were encountered: