Make prediction grid
Description
This function creates a grid for prediction.
Usage
1 2  mkpredgrid2d(pnts.x, pnts.y, par.x, par.y, isby = FALSE, chull = FALSE,
exf = 1)

Arguments
pnts.x 
x coordinate of the domain. Could also be a twocolumn matrix containing the x and y coordinates 
pnts.y 
y coordinate of the domain. Should be
omitted or set to 
par.x 
A scalar parameter for the x component of the new
grid. This parameter corresponds to either the 
par.y 
As in 
isby 
If 
chull 
Whether to calculate the convex hull of the points.
Set this to 
exf 
An expansion factor of the convex hull of

Details
If chull
this function first calculates the convex hull of
the points. If exf
is not 1 the borders are expanded. Then
the function calls point.in.polygon
to select
points that fall inside the borders.
Value
A list with components

grid
A twocolumn matrix with the prediction grid 
xycoord
A list with components "x" and "y" containing the sequence of points used to create the grid 
xygrid
A matrix with the full square grid derived fromxycoord

borders
The (expanded) borders of the domain
See Also
pred_grid
Examples
1 2 3 4 5 6 7 8 9  ## Not run:
data(rhizoctonia)
predgrid < mkpredgrid2d(rhizoctonia[c("Xcoord", "Ycoord")],
par.x = 100, chull = TRUE, exf = 1.2)
plot(predgrid$borders, type = "l") # Domain for prediction
points(predgrid$grid, pch = 20, cex = .3) # Prediction locations
points(rhizoctonia[c("Xcoord", "Ycoord")]) # Observed locations
## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.