View source: R/get_unique_values.R
get_unique_values | R Documentation |
This function returns the unique values of an object.
get_unique_values(x, simplify = FALSE, verbose = TRUE)
x |
Vector, matrix, raster, stars, or terra object or list of previous. |
simplify |
If true, a vector will be returned instead of a list for 1-dimensional input |
verbose |
If true, warning messages are printed |
Fast and memory friendly Rcpp implementation to find the unique values of an object.
landscape <- terra::rast(landscapemetrics::landscape)
get_unique_values(landscape)
landscape_stack <- c(landscape, landscape, landscape)
get_unique_values(landscape_stack)
landscape_matrix <- terra::as.matrix(landscape, wide = TRUE)
get_unique_values(landscape_matrix)
x_vec <- c(1, 2, 1, 1, 2, 2)
get_unique_values(x_vec)
landscape_list <- list(landscape, landscape_matrix, x_vec)
get_unique_values(landscape_list)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.