Mask slope raster, setting the slope to zero for the pixels overlapping the river area.
mask_slope(slope, river, lthresh = 0.001, target = 0)updated slope raster
raster data of slope
vector/polygon data of river
lower numerival threshold to consider slope non-zero
value to set for pixels overlapping river area