powered by
stars
Extracts the values of a single layer in a stars object to a matrix.
matrix
layer_to_matrix(x, check = TRUE)
A matrix with the layer values, having the same orientation as the raster (i.e., rows represent the y-axis and columns represent the x-axis).
A stars raster with one attribute and two dimensions, x and y, i.e., a single-band raster.
x
y
Whether to check (and fix if necessary) that input has one attribute, one layer and x-y as dimensions 1-2 (default is TRUE).
TRUE
data(dem) m = layer_to_matrix(dem) m
Run the code above in your browser using DataLab