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/RipUvK.r

View File Source Download File No help file available

Function: Annuli

Function Description: Annuli

Calculates the total area in a series of annuli, summed over all individuals in the submitted dataset. Calls CalcRingArea to do the calculations for the area within a distance r of every individual, then subtracts successive areas to get the area within annuli. This is ordinarily only used as a subroutine of RipUvK.

Function Arguments:

ArgumentDefault Value
spdata
r
plotdim

Arguments Description:

  • spdata: A single dataframe with x-y coordinates of individuals.
  • r: A vector of distances defining the successive annuli.
  • plotdim: The x and y dimensions of the plot in which the individuals are mapped.


Function Source:

Annuli=function(spdata,r,plotdim)
{
TotalAreaPerRing=numeric()
AreaPerCircle=matrix(nrow=dim(spdata)[1],ncol=length(r)+1)

TotalAreaPerRing[1]=0
AreaPerCircle[,1]=0

for(i in 1:length(r))
{
ringarea=CalcRingArea(spdata,r[i],plotdim)

TotalAreaPerRing[i+1]=ringarea$total
AreaPerCircle[,i+1]=ringarea$each
}

AreaPerRing=t(apply(AreaPerCircle,1,diff))

return(list(total=diff(TotalAreaPerRing),each=AreaPerRing))
}