######Calculation based on multiple plots
####convert raw data to species matrix
##raw data of multiple plots
data(herbdata)
herb.spematrix<-longtowide(longdata=herbdata,left="plot.id",up="spe.id",inner="abundance")
##compute species mcIntosh diversity index for each plot
herb.mcIntosh<-mcIntosh(herb.spematrix)
herb.mcIntosh
Run the code above in your browser using DataLab