科学网

 找回密码
  注册

tag 标签: McIntosh

相关帖子

版块 作者 回复/查看 最后发表

没有相关内容

相关日志

A R function to calculate the McIntosh diversity index
chaizongzheng 2015-11-29 09:03
Formula as follow: where D m is McIntosh diversity index,N is the total number of individuals in the plant population, N i is the number of individuals of the i th species. R function as follow: #A R function for calculating the mcIntosh diversity index mcIntosh-function(x,MARGIN = 1){ x - drop(as.matrix(x)) if (length(dim(x)) 1) { total - apply(x, MARGIN, sum) Dm-(total-(rowSums(x^2))^0.5)/(total-total^0.5) } else { Dm - (sum(x)-(sum(x^2))^0.5)/(sum(x)-sum(x)^0.5)} return(Dm) } Example: library(vegan) data(BCI) mcIntosh(BCI) mcIntosh.txt
个人分类: R software|2786 次阅读|0 个评论

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-6-19 01:12

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部