Create a binary mask from a raster: NAs are converted to 0s, and any other value to 1.
make_binary_mask(x)
x
a terra::SpatRaster
terra::SpatRaster
a terra::SpatRaster with 0s and 1s