Topic: Growth

Topic Description:

Functions for analyzing tree growth, designed for the standard CTFS R Analytical Tables.



File: growth/growthfit.bin.r

View File Source Download File No help file available

Function: bad.binparam

Function Description: bad.binparam

This prevents the bin parameters from moving outside the x range, and keeps the minimum bin width wider than MINBIN of the xrange. It also requires at least MINSAMPLE individuals per bin. The ellipsis handles the submission of MINBIN and MINBINSAMPLE, if they are not submitted, default values are assigned.

Function Arguments:

ArgumentDefault Value
x
param
...

Function Source:

bad.binparam=function(x,param,...)
{
x=as.matrix(x)

# browser()

noparam=length(param)
bins=(noparam)/2

if(bins==1) return(FALSE)

internal=param[1:(bins-1)]
if(length(which(internal<=min(x)))>0) return(TRUE)
if(length(which(internal>=max(x)))>0) return(TRUE)

breaks=c(min(x),internal,max(x))

if(!enoughSamplePerBin(x=x,b=breaks,...)) return(TRUE)
if(!wideEnoughBins(x=x,b=breaks,...)) return(TRUE)

return(FALSE)
}