Skip to contents

Generate a grid of knot locations to run SALSA2D.

Usage

getKnotgrid(coordData, numKnots = 300, plot = TRUE)

Arguments

coordData

nx2 matrix or data frame of coordinates representing data locations

numKnots

(default = 300)). The user may choose how many legal knot locations are available (only if more than 400 )

plot

(default = TRUE). Logical stating whether a plot showing the legal knot positions is given.

Value

A (numKnots x 2) matrix of knot locations.

Details

SALSA2D requires a grid of knot locations to determine the best locations. Illegal knot positions (those not close to data) are kept as a row in the data frame of locations but given c(NA, NA) to avoid a knot considered.

Examples

 if (FALSE) {
data(dis.data.re)
# bootstrap data without stratification
dis.data.re$survey.id<-paste(dis.data.re$season,dis.data.re$impact,sep="")
require(mrds)
result<-ddf(dsmodel=~mcds(key="hn", formula=~1), data=dis.data.re, method="ds",
             meta.data=list(width=250))
dis.data.re<-create.NHAT(dis.data.re,result)

knotgrid<-getKnotgrid(cbind(dis.data.re$x.pos, dis.data.re$y.pos))}