IFNknn: k-nearest neighbours for IFN plots

Description Usage Arguments Value Examples

View source: R/IFNknn.R

Description

Builds a weighted neighbouring object containing the k-nearest neighbours as well as the distances to them, from a matrix of longitude/latitude coordinates.

Usage

1
IFNknn(coords, k = 57, verbose = TRUE)

Arguments

coords

Matrix of plot coordinates in longitude and latitude, with plot IDs as row names.

k

Number of neighbours to determine.

verbose

Boolean flag to turn on console output informing of the calculation process.

Value

An object of class list with elements 'neighbours' and 'distances'. Plot IDs are stored in attribute 'IDs'

Examples

1
2
3
4
5
6
7
# Load example plot coordinates
data(examplePlotCoords)
examplePlotCoords

# Build neighbour object (only one neighbour)
nb = IFNknn(examplePlotCoords, k = 1)
nb

miquelcaceres/IFNdyn documentation built on Feb. 1, 2021, 10:55 a.m.