###################################### # Set up the points at which to determine the values ###################################### f.create.grid <- function(data, numb.xy.pts, size = {}) { if (length(size) == 4) { x.min <- size[1] x.max <- size[2] y.min <- size[3] y.max <- size[4] } else { x.min <- floor(min(data[,1])) x.max <- ceiling(max(data[,1])) y.min <- floor(min(data[,2])) y.max <- ceiling(max(data[,2])) } xp <- seq(x.min, x.max, (x.max - x.min)/numb.xy.pts[1]) yp <- seq(y.min, y.max, (y.max - y.min)/numb.xy.pts[2]) zp <- expand.grid(xp, yp) list (xp = xp, yp = yp, zp = zp) }