I am attempting to add a column that provides the area of my HUC_12 watershed polygons to a watershed data set, but the only code online that demonstrates how to do this is using the raster library, which is incompatible with the sf package and tidyverse. If you have an idea of how to create this is sf, please let me know.
Here is the code I was using for reference:
library(raster) shape = shapefile("~/Downloads/all_borders.shp") shape$Area_sqm = area(shape) raster::area(shape)
Thank you for your assistance.