get_centroids
Centroid of patches
get_centroids(landscape, directions, cell_center, return_sp, verbose) ## S3 method for class 'RasterLayer' get_centroids( landscape, directions = 8, cell_center = FALSE, return_sp = FALSE, verbose = TRUE ) ## S3 method for class 'RasterStack' get_centroids( landscape, directions = 8, cell_center = FALSE, return_sp = FALSE, verbose = TRUE ) ## S3 method for class 'RasterBrick' get_centroids( landscape, directions = 8, cell_center = FALSE, return_sp = FALSE, verbose = TRUE ) ## S3 method for class 'stars' get_centroids( landscape, directions = 8, cell_center = FALSE, return_sp = FALSE, verbose = TRUE ) ## S3 method for class 'list' get_centroids( landscape, directions = 8, cell_center = FALSE, return_sp = FALSE, verbose = TRUE )
landscape |
Raster* Layer, Stack, Brick, SpatRaster (terra), stars, or a list of rasterLayers. |
directions |
The number of directions in which patches should be connected: 4 (rook's case) or 8 (queen's case). |
cell_center |
If true, the coordinates of the centroid are forced to be a cell center within the patch. |
return_sp |
If true, a SpatialPointsDataFrame is returned. |
verbose |
Print warning messages |
Get the coordinates of the centroid of each patch. The centroid is by default
defined as the mean location of all cell centers. To force the centroid to be
located within each patch, use the cell_center
argument. In this case, the
centroid is defined as the cell center that is the closest to the mean location.
# get centroid location get_centroids(landscape)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.