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

View File Source Download File No help file available

Function: calcslope

Function Description: calcslope

None provided.

Function Arguments:

ArgumentDefault Value
z
gridsize20
z
gridsize20

Function Source:

calcslope=function(z, gridsize=20)
{
z2=z[3]-z[2]
z1=z[1]-z[2]

if(z2==0)
{
if(z1==0) return(0)
else denom=sqrt( 1+(gridsize/z1)^2 )

theta1 = acos( (-gridsize/z1)/denom )
theta2 = acos( (gridsize/z1)/denom )
}

else
{
denom = sqrt( 1+(z1/z2)^2+(gridsize/z2)^2 )

theta1 = acos( (-gridsize/z2)/denom )
theta2 = acos( (gridsize/z2)/denom )
}

if(theta1<=theta2) return(180*theta1/pi)
else return(180*theta2/pi)
}