Topic: Growth

Topic Description:

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



File: growth/growthfit.graph.r

View File Source Download File No help file available

Function: binGraphManySpecies

Function Description: binGraphManySpecies

Make a graph of AGB growth and model fit of many species overlaid, predicted functions only. Must submit name of data objects (not the object, just the name in quote marks!).

Function Arguments:

ArgumentDefault Value
fulldataname
darken8
xrangec(-3,3)
yrangec(0,.1)
xtitleNULL
ytitleNULL
epdf
outfile"growth/linearbin.multi.pdf"
h8
w10

Function Source:


binGraphManySpecies=function(fulldataname,darken=8,xrange=c(-3,3),yrange=c(0,.1),xtitle=NULL,ytitle=
        NULL, export=pdf,outfile="growth/linearbin.multi.pdf",h=8,w=10)
{
if(!is.null(export))
{
on.exit(graphics.off())
export(file=outfile,height=h,width=w)
}

fulldata=get(fulldataname)

result=compare.growthbinmodel(fit=fulldata,export=NULL,makegraph=FALSE)
sumtable=assembleBinOutput(inputtable=result,fulldata=fulldata,sitename='bci')

species=names(fulldata)
nospp=length(species)
if(darken else select=1:nospp

if(is.null(ytitle)) ytitle='AGB growth'
if(is.null(xtitle)) xtitle='DBH'

for(i in 1:length(species))
{
onesp=species[i]
spdata=fulldata[[onesp]]

bin=sumtable[onesp,]$MaxBin
onebindata=spdata[[bin]]


if(i==1) graph.growthmodel.spp(fit=onebindata,xrange=xrange,yrange=yrange,xtitle=xtitle,ytitle=yt
        itle,
add=FALSE,addpts=FALSE,modelclr='gray',modellwd=.5,withSD=NULL,reg
        clr=NULL)

if(i %in% select) graph.growthmodel.spp(fit=onebindata,add=TRUE,addpts=FALSE,modelclr='black',mod
        ellwd=1.5,withSD=NULL,regclr=NULL)
else graph.growthmodel.spp(fit=onebindata,add=TRUE,addpts=FALSE,modelclr='gray',modellwd=.5,withS
        D=NULL,regclr=NULL) }