Sample a random DEM with specified size from a larger DEM
Arguments
- data
Digital elevation model of class RasterLayer.
- L
Size of square to cut out of DEM.
- allow_NA
Proportion of NA values allowed in the sample. Useful when DEM is not regular.
- plot
Logical. Plot the DEM and the cropped section?
- max_iter
Maximum number of random crops to try when allow_NA = FALSE before failing.