Let’s get some flow data for the
NHDPlus subset included with nhdR
package. Our goal is to
adjust the color and size of each reach by their average flow.
ggplot() +
geom_sf(data = gull$sp$NHDWaterbody) +
geom_sf(data = gull$sp$NHDFlowLine)
#> old-style crs object detected; please recreate object with a recent sf::st_crs()
#> old-style crs object detected; please recreate object with a recent sf::st_crs()
#> old-style crs object detected; please recreate object with a recent sf::st_crs()
NHDPlus includes two estimates of flow:
gull_sf <- dplyr::filter(gull_sf, !is.na(Q0001F))
#> old-style crs object detected; please recreate object with a recent sf::st_crs()
gull_sf %>%
ggplot() +
geom_sf(data = gull$sp$NHDWaterbody) +
geom_sf(aes(color = gull_sf$Q0001F), size = gull_sf$Q0001F / 20) +
labs(color = "EROM Flow (cms)")
#> old-style crs object detected; please recreate object with a recent sf::st_crs()
#> Warning: Use of `gull_sf$Q0001F` is discouraged.
#> ℹ Use `Q0001F` instead.
gull_sf <- filter(gull_sf, !is.na(MAFLOWV))
gull_sf %>%
ggplot() +
geom_sf(data = gull$sp$NHDWaterbody) +
geom_sf(aes(color = gull_sf$MAFLOWV), size = gull_sf$MAFLOWV / 20) +
labs(color = "Vogel Flow (cms)")
#> old-style crs object detected; please recreate object with a recent sf::st_crs()
#> Warning: Use of `gull_sf$MAFLOWV` is discouraged.
#> ℹ Use `MAFLOWV` instead.