Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

outer.convhull

Version of outer which operates only in a convex hull


Description

This version of outer evaluates FUN only on that part of the grid cx x cy that is enclosed within the convex hull of the points (px,py).

This can be useful for spatial estimation if no extrapolation is wanted.

Usage

outer.convhull(cx,cy,px,py,FUN,duplicate="remove",...)

Arguments

cx

x cordinates of grid

cy

y cordinates of grid

px

vector of x coordinates of points

py

vector of y coordinates of points

FUN

function to be evaluated over the grid

duplicate

indicates what to do with duplicate (px_i,py_i) points, default "remove".

...

additional arguments for FUN

Value

Matrix with values of FUN (NAs if outside the convex hull).

Author(s)

A. Gebhardt

See Also

Examples

x<-runif(20)
y<-runif(20)
z<-runif(20)
z.lm<-lm(z~x+y)
f.pred<-function(x,y)
  {predict(z.lm,data.frame(x=as.vector(x),y=as.vector(y)))}
xg<-seq(0,1,0.05)
yg<-seq(0,1,0.05)
image(xg,yg,outer.convhull(xg,yg,x,y,f.pred))
points(x,y)

tripack

Triangulation of Irregularly Spaced Data

v1.3-9.1
ACM | file LICENSE
Authors
Fortran code by R. J. Renka. R functions by Albrecht Gebhardt <albrecht.gebhardt@aau.at>. With contributions from Stephen Eglen <stephen@anc.ed.ac.uk>, Sergei Zuyev <sergei@stams.strath.ac.uk> and Denis White <white.denis@epamail.epa.gov>
Initial release
2020-03-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.