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: gxgy.to.quad

Function Description: gxgy.to.quad

Calculate a quadrat name (column number then row number, as a 4-digit character string) from gy-gy. If start is set to zero, quadrats start with 0000, otherwise, 0101.

Function Arguments:

ArgumentDefault Value
gx
gy
gridsize20
plotdimc(1000,500)
digits2
start'zero'

Function Source:

gxgy.to.quad=function(gx,gy,gridsize=20,plotdim=c(1000,500),digits=2,start='zero')
{
rc=gxgy.to.rowcol(gx,gy,gridsize,plotdim)
if(start=='zero') rc=rc-1

if(digits!=2) return("Must rewrite if three digit quadrats")

lowrow=which(rc$row<10 & rc$row>(-1))
rowstr=as.character(rc$row)
rowstr[lowrow]=pst("0",rowstr[lowrow])

lowcol=which(rc$col<10 & rc$col>(-1))
colstr=as.character(rc$col)
colstr[lowcol]=pst("0",colstr[lowcol])

return(pst(colstr,rowstr))
}