UCSBCarpentry / 2022-08-09-ucsb-r-geospatial

This is the repo for UCSB Lib's R Geospatial workshop on August 9 and 11, 2022
https://ucsbcarpentry.github.io/2022-08-09-ucsb-r-geospatial/
Other
0 stars 0 forks source link

Ep 9: naming inconsitency #12

Open djhunter opened 2 years ago

djhunter commented 2 years ago

st_crs(point_HARV)

should be:

st_crs(HARV_points)
djhunter commented 2 years ago

Similarly,

st_bbox(point_HARV) should be

st_bbox(HARV_points)
djhunter commented 2 years ago

Same problem with plot. Corrected version:

ggplot() +
  geom_sf(data = country_boundary_US, size = 2, color = "gray18") +
  geom_sf(data = state_boundary_US, color = "gray40") +
  geom_sf(data = HARV_points, shape = 19, color = "purple") +
  ggtitle("Map of Contiguous US State Boundaries") +
  coord_sf()
djhunter commented 2 years ago

And again in the final challenge solution. Corrected version:

ggplot() +
    geom_sf(data = NE.States.Boundary.US, aes(color ="color"), show.legend = "line") +
    scale_color_manual(name = "", labels = "State Boundary", values = c("color" = "gray18")) +
    geom_sf(data = HARV_points, aes(shape = "shape"), color = "purple") +
    scale_shape_manual(name = "", labels = "Fisher Tower", values = c("shape" = 19)) +
    ggtitle("Fisher Tower location") +
    theme(legend.background = element_rect(color = NA)) +
    coord_sf()