This function calculates the spatial mean based on the k-nearest neighbors of a focal point or set of focal points.
Arguments
- source_xy
A simple features object of type POINT with the source points for interpolation
- target_xy
A simple features object of type POINT with the target points for interpolation
- z
The name of the column with the variable in
source_xy
to interpolate- k
A number that defines the number of neighbors used for interpolation
- longlat
TRUE if coordinates are in long/lat