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:
| Argument | Default Value |
|---|---|
| x | |
| param | |
| ... |
Function Source:
bad.binparam=function(x,param,...)
{
extra=list(...)
if(is.null(extra$MINBIN)) MINBIN=0.1
else MINBIN=extra$MINBIN
if(is.null(extra$MINBINSAMPLE)) MINBINSAMPLE=5
else MINBINSAMPLE=extra$MINBINSAMPLE
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))
# browser()
if(!enoughSamplePerBin(x=x,b=breaks,...)) return(TRUE)
if(!wideEnoughBins(x=x,b=breaks,...)) return(TRUE)
return(FALSE)
}
{
extra=list(...)
if(is.null(extra$MINBIN)) MINBIN=0.1
else MINBIN=extra$MINBIN
if(is.null(extra$MINBINSAMPLE)) MINBINSAMPLE=5
else MINBINSAMPLE=extra$MINBINSAMPLE
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))
# browser()
if(!enoughSamplePerBin(x=x,b=breaks,...)) return(TRUE)
if(!wideEnoughBins(x=x,b=breaks,...)) return(TRUE)
return(FALSE)
}