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: CalcRingArea
Function Description: CalcRingArea
Given a dataframe that includes gx, gy coordinates, and a single value radius, finds the area within radius from all points (summed). In the absence of edge corrections, this would be simply N*pi*radius^2, where N is the number of points. But this uses the function partialcirclearea to do the edge correction. This is ordinarily only used as a subroutine for RipUvK.Function Arguments:
| Argument | Default Value |
|---|---|
| data | |
| radius | |
| plotdim |
Function Source:
CalcRingArea=function(data,radius,plotdim)
{
nopts=dim(data)[1]
internalArea=numeric()
for(i in 1:nopts)
{
xdist=data$gx[i]
if(plotdim[1]-data$gx[i]
internalArea[i]=partialcirclearea(radius,xdist,data$gy[i],plotdim[2]-data$gy[i])
}
return(list(total=sum(internalArea),each=internalArea))
}
{
nopts=dim(data)[1]
internalArea=numeric()
for(i in 1:nopts)
{
xdist=data$gx[i]
if(plotdim[1]-data$gx[i]
internalArea[i]=partialcirclearea(radius,xdist,data$gy[i],plotdim[2]-data$gy[i])
}
return(list(total=sum(internalArea),each=internalArea))
}