constructKnots function

constructKnots

constructKnots

Construct a Regular Grid of Knot Locations for Spatial GPP Model

constructKnots(sData, nKnots = NULL, knotDist = NULL, minKnotDist = NULL)

Arguments

  • 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

Returns

a data frame with knot locations

Details

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.

Examples

#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)
  • Maintainer: Otso Ovaskainen
  • License: GPL-3 | file LICENSE
  • Last published: 2022-08-11