Last chance! 50% off unlimited learning
Sale ends in
This function returns the unique values in a SpatRaster.
# S4 method for SpatRaster
unique(x, incomparables=FALSE, ...)
SpatRaster
logical. If TRUE
, the unique values are determined for all layers together, and the result is a matrix. If FALSE
, each layer is evaluated separately, and a list is returned.
additional arguments. none implemented
vector or matrix
# NOT RUN {
r <- rast(ncol=5, nrow=5)
values(r) <- rep(1:5, each=5)
unique(r)
s <- c(r, round(r/3))
unique(s)
unique(s,TRUE)
# }
Run the code above in your browser using DataLab