getKnotgrid: Generate a grid of knot locations to run SALSA2D.

View source: R/getKnotgrid.R

getKnotgridR Documentation

Generate a grid of knot locations to run SALSA2D.

Description

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.

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.

Value

A (numKnots x 2) matrix of knot locations.

Examples

 ## Not run: 
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))
## End(Not run)


lindesaysh/MRSea documentation built on May 11, 2024, 11:30 p.m.