interpCov.Rd
At the moment, this is based on the function interp.surface
from
the package fields (bilinear interpolation).
interpCov(locs, x_grid, y_grid, cov_mat)
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. |
Interpolated value of the covariate at the point xy.
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