Creates a new instance of the fs_nnindex function and initialises it with zone and unit information.

gen_nnindex(zone, zoneField = NULL, unit = "m")

Arguments

zone

A spatial polygon object of sf or sp type. If omitted all observations in X are assumed to be within one zone and the area of the minimum bounding circle is used for the nearest neighbour index.

zoneField

(Optional) Column name of unique identifiers in zone to use. If omitted, the 'zoneID' will be numbered 1:nrow(zone).

unit

character or units object to define distance. Default will attempt to coerce units to meters.

Details

This is a function factory. It creates a partial function in order to allow fs_nnindex to be used by the internal loop of calculate_footstats. This function will generally not be used on its own.