Topic: Biomass

Topic Description:

Functions for calculating above-ground tree biomass in CTFS plots.



File: biomass/biomass.CTFSdb.r

View File Source Download File No help file available

Function: AGB.tree

Function Description: AGB.tree

Computes AGB of each tree in a table, grouping all stems of one tree and adding there agbs. The submitted table, df, must have dbh, species name (sp), and a treeID to identify which tree every stem belong to. There must be just one dbh for each stem. Returns a dataframe with one row per tree, including the treeID and total agb per tree. Note that it will have fewer rows than the table submitted. This is called by biomass.CTFSdb in the standard calculation of biomass for CTFS R tables.

Function Arguments:

ArgumentDefault Value
df
dbhunit'mm'
plot'bci'
wsgdatawsg.ctfs2
forest'moist'
ht.paramNULL
htmodelpredht.asym

Arguments Description:

biomasstbl=AGB.tree(df=bci.stem1) dim(bci.stem1) dim(biomasstbl) head(biomasstbl)


Function Source:


AGB.tree=function(df,dbhunit='mm',plot='bci',wsgdata=wsg.ctfs2,forest='moist',ht.param=NULL,htmodel=
        predht.asym) {

AGB.stem=AGB.ind(df=df,dbhunit=dbhunit,plot=plot,wsgdata=wsgdata,forest=forest,ht.param=ht.param,ht
        model=htmodel)
AGB.tree=tapply(AGB.stem,df$treeID,sum,na.rm=TRUE)

result=data.frame(treeID=as.numeric(names(AGB.tree)),agb=AGB.tree)
return(result)
}