powered by
This makes use of the terrain function of the terra package
get_slope(dem)
raster of derived slope over dem extent
raster data of dem