spatial_knn: Add spatial k nearest neighbor (sknn) values

View source: R/spatial.R

spatial_knnR Documentation

Add spatial k nearest neighbor (sknn) values

Description

Add spatial k nearest neighbor (sknn) values

Usage

spatial_knn(
  x,
  vars,
  k = 3,
  lon = "lon",
  lat = "lat",
  suffix = "_lag",
  dists = NULL
)

Arguments

x

A data frame with variables for lon and lat

vars

A vector of variables to regress with sknn

k

The value for 3, default 3

lon

The lon variable

lat

The lat variable

suffix

The suffix to use, default "_lag"

dists

A distance matrix, if not provided, will be computed from lon and lat

Value

A data frame with added variables


Deleetdk/kirkegaard documentation built on Feb. 28, 2025, 5:04 p.m.