kpointmean: A funcion that implements k-point mean interpolation

View source: R/kpointmean.R

kpointmeanR Documentation

A funcion that implements k-point mean interpolation

Description

This function calculates the spatial mean based on the k-nearest neighbors of a focal point or set of focal points.

Usage

kpointmean(source_xy, z, target_xy, k, longlat = FALSE)

Arguments

source_xy

A two column vector with x and y coordinates of the source points for interpolation

z

A numeric vector of variable values at points 'source_xy'

target_xy

A two column vector with x and y coordinates of the target points for interpolation

k

A number that defines the number of neighbors used for interpolation

longlat

TRUE if coordinates are in long/lat

Value

A SpatialPolygonsDataFrame object.

Examples

# Interpolate
target_xy = expand.grid(x = seq(0.5, 259.5, 2.2), y = seq(0.5, 299.5, 2.2))
source_xy = cbind(x = Walker_Lake$X, y = Walker_Lake$Y)

paezha/geog4ga3 documentation built on Nov. 20, 2024, 2:18 a.m.