Skip to contents

This function interpolates values at specified points using x, y coordinates and a target variable from a shapefile. It supports "Kriging" and "Tps" interpolation methods.

Usage

shapefile_interpolate(
  shapefile,
  z,
  x = "x",
  y = "y",
  interpolation = c("Kriging", "Tps"),
  verbose = FALSE
)

Arguments

shapefile

An sf object containing the x, y, and target variable (z) columns. It is highly recommended to use shapefile_measures() to obtain this data.

z

A string specifying the name of the column in the shapefile that contains the target variable to be interpolated.

x

A string specifying the name of the column containing x-coordinates. Default is 'x'.

y

A string specifying the name of the column containing y-coordinates. Default is 'y'.

interpolation

A character vector specifying the interpolation method. Options are "Kriging" or "Tps".

verbose

Logical; if TRUE, progress messages will be displayed.

Value

A vector of interpolated values at the specified points.