View source: R/constructKnots.R
constructKnots | R Documentation |
Construct a Regular Grid of Knot Locations for Spatial GPP Model
constructKnots(sData, nKnots = NULL, knotDist = NULL, minKnotDist = NULL)
sData |
a dataframe containing spatial or temporal coordinates of units of the random level |
nKnots |
the number of knots wanted on the spatial dimension with the shortest range |
knotDist |
the distance between the wanted knots |
minKnotDist |
the minimum distance of a knot to the nearest data point |
This is a helper function for spatial Hmsc models with the
spatial method set to GPP where user must provide knot
locations. Knot locations with a distance greater than
minKnotDist
to the nearest data point are dropped from
the grid. If the input locations are
SpatialPoints
data, these are treated like
Euclidean coordinates, and if the points are not projected, a
warning is issued.
Only one of nKnots
and minKnotDist
arguments can be provided.
a data frame with knot locations
#Creating knots for some 2 dimensional spatial data n = 100 xycoords = matrix(runif(2*n),ncol=2) xyKnots = constructKnots(xycoords,knotDist = 0.2, minKnotDist = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.