interpCov: Interpolate 2D covariate

View source: R/gradientInterpolation.R

interpCovR Documentation

Interpolate 2D covariate

Description

At the moment, this is based on the function interp.surface from the package fields (bilinear interpolation).

Usage

interpCov(locs, x_grid, y_grid, cov_mat)

Arguments

locs

Point where the covariate should be interpolated

x_grid

Grid on which the covariate is known

y_grid

Grid on which the covariate is known

cov_mat

Matrix of values of the covariate at the points given by x_grid and y_grid.

Details

Note that covmat needs to rotated (as e.g. with "image"), so you might need to use something like covmat <- t(apply(as.matrix(covraster),2,rev)) before passing it to this function

Value

Interpolated value of the covariate at the point xy.


papayoun/Rhabit documentation built on July 19, 2023, 8:04 p.m.