constructKnots: constructKnots

View source: R/constructKnots.R

constructKnotsR Documentation

constructKnots

Description

Construct a Regular Grid of Knot Locations for Spatial GPP Model

Usage

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

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.

Value

a data frame with knot locations

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)


Hmsc documentation built on Aug. 11, 2022, 5:11 p.m.