top_n_focals: Identify the focal indices with the highest values

View source: R/utils.R

top_n_focalsR Documentation

Identify the focal indices with the highest values

Description

Generate a data.frame containing the cell indices of the focal cells with the n highest values. Additionally, include columns for the coordinates (xy) corresponding to the center of each cell.

Usage

top_n_focals(focal, n)

Arguments

focal

focal as output from terra::focal().

n

positive integer value greater or equal to 1.

Author(s)

Martin Haringa


spatialrisk documentation built on June 8, 2025, 9:40 p.m.