Topic: Mortality

Topic Description:

Functions for calculating mortality rates from CTFS formatted R Analytical Tables.



File: mortality/mortality.r

View File Source Download File No help file available

Function: mortality.eachspp

Function Description: mortality.eachspp

Calculate mortality for each species in given dbh categories. It sets the split variables using the species name and submitted dbh classbreaks and then uses mortality to do the calculation. See argument descriptions for mortality. Return object is the list from mortality and can be passed to assemble.demography for a convenient format.

Function Arguments:

ArgumentDefault Value
census1
census2
classbreakc(10,100,300)
alivecodec("A","AB","AS")

Sample Usage:

CTFSplot("bci",5:6)
mort.data=mortality.eachspp(bci.full5,bci.full6)
mort.table1=assemble.demography(mort.data,type="m",whichdbhcat=1)
mort.table2=assemble.demography(mort.data,type="m",whichdbhcat=2)
mort.table3=assemble.demography(mort.data,type="m",whichdbhcat=3)


Function Source:

mortality.eachspp=function(census1,census2,classbreak=c(10,100,300),alivecode=c("A","AB","AS"))
{
allbreak=c(classbreak,10000)
dbhclass=as.numeric(as.character(cut(census1$dbh,breaks=allbreak,right=F,labels=classbreak)))

sp=census1$sp
result=mortality(census1,census2,alivecode=alivecode,split1=sp,split2=dbhclass)
return(result)
}