Topic: Spatial

Topic Description:

Functions for calculating Ripley's K from CTFS R Analytical Tables, many routines for quadrat-based calculations. and calculations of wavelet variance.



File: spatial/quadfunc.r

View File Source Download File No help file available

Function: findborderquads

Function Description: findborderquads

Calculate indices of neighboring quadrats, for a given quadrat index.

Function Arguments:

ArgumentDefault Value
index
dist20
gridsize20
plotdimc(1000,500)

Function Source:

findborderquads=function(index,dist=20,gridsize=20,plotdim=c(1000,500))
{
bound.index=numeric(8)
no.boundaries=0

row=index.to.rowcol(index,gridsize,plotdim)$row
col=index.to.rowcol(index,gridsize,plotdim)$col
maxrow=plotdim[2]/gridsize
maxcol=plotdim[1]/gridsize

layers=floor(dist/gridsize)

for(i in (row-layers):(row+layers))
for(j in (col-layers):(col+layers))
if(i!=row | j!=col)
if(i>=1 & i<=maxrow & j>=1 & j<=maxcol)
{
no.boundaries=no.boundaries+1
bound.index[no.boundaries]=rowcol.to.index(i,j,gridsize,plotdim)
}

return( bound.index[bound.index>0] )
}