powered by
Quadtree
Returns all cell values of a Quadtree as a numeric vector.
# S4 method for Quadtree as_vector(x, terminal_only = TRUE)
a numeric vector
a Quadtree
boolean; if TRUE (the default) only values of terminal cells are returned. If FALSE, all cell values are returned.
TRUE
FALSE
as_data_frame creates a data frame from a Quadtree that has all the cell values as well as details about each cell's size and extent.
as_data_frame
library(quadtree) habitat <- terra::rast(system.file("extdata", "habitat.tif", package="quadtree")) qt <- quadtree(habitat, .2) head(as_vector(qt), 20) head(as_vector(qt, FALSE), 20)
Run the code above in your browser using DataLab