Learn R Programming

habtools (version 1.1.1)

dem_sample: Sample a random DEM with specified size from a larger DEM

Description

Sample a random DEM with specified size from a larger DEM

Usage

dem_sample(data, L, allow_NA = 0, plot = FALSE, max_iter = 100)

Value

Digital elevation model of class RasterLayer.

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.

Examples

Run this code
dem <- dem_sample(horseshoe, L = 2, plot=TRUE)

Run the code above in your browser using DataLab