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: binGraphSampleSpecies
Function Description: binGraphSampleSpecies
Make a single graph, 4 panels, of AGB growth and model fit. Must submit four species names (though they could be the same. Enter names of data objects (not the object, just the name in quote marks!): either one data object, or a list of four such objects; if only one, all four graphs are based on the single one. Likewise, enter either one bin number, or four.Function Arguments:
| Argument | Default Value |
|---|---|
| fulldataname | |
| species | |
| whichbin | |
| export | |
| outfile | "growth/linearbin.summary.pdf" |
| h | 8 |
| w | 10 |
Sample Usage:
attach('growth/linearbin.fittrim3.bci.rdata') attach('growth/growthfitYiching/linearbin.fit.allspp.rdata') attach('growth/linearbin.fit.edoro.rdata') attach('growth/linearbin.fit.lenda.rdata') binGraphSampleSpecies(fulldata='linearbin.fit.allspp',species=c('pri2co','tri2tu','brosal','jac1co'),whichbin=2,export=NULL) binGraphSampleSpecies(fulldata=c('linearbin.fit.allspp','linearbin.fit.trim3','linearbin.fit.edoro3','linearbin.fit.lenda3'), species=c('PYRESH','pri2co','JULBSE','GILBDE'),whichbin=3,export=NULL) binGraphSampleSpecies(fulldata='linearbin.fit.allspp',species=c('pri2co','pri2co','brosal','brosal'),whichbin=c(2,3,2,3),export=NULL)
Function Source:
binGraphSampleSpecies=function(fulldataname,species,whichbin,export=pdf,outfile="growth/linearbin.su
mmary.pdf",h=8,w=10) {
if(!is.null(export))
{
on.exit(graphics.off())
export(file=outfile,height=h,width=w)
}
if(length(fulldataname)==1) fulldataname=rep(fulldataname,length(species))
if(length(whichbin)==1) whichbin=rep(whichbin,length(species))
par(mfcol=c(2,2),mai=c(.75,.75,.1,.1))
for(i in 1:length(species))
{
xtitle=ytitle=''
if(i==1 | i==2) ytitle='AGB growth'
if(i==2 | i==4) xtitle='DBH'
onesp=species[i]
spdata=get(fulldataname[i])[[onesp]]
onebindata=spdata[[whichbin[i]]]
graph.growthmodel.spp(fit=onebindata,maintitle=onesp,xtitle=xtitle,ytitle=ytitle)
}
}