diversity(vegan)
diversity()所属R语言包:vegan
Ecological Diversity Indices and Rarefaction Species Richness
生态多样性指数和稀疏的物种丰富度
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Shannon, Simpson, and Fisher diversity indices
香农·辛普森和费舍尔多样性指数
用法----------Usage----------
diversity(x, index = "shannon", MARGIN = 1, base = exp(1))
rarefy(x, sample, se = FALSE, MARGIN = 1)
rrarefy(x, sample)
drarefy(x, sample)
rarecurve(x, step = 1, sample, xlab = "Sample Size", ylab = "Species",
label = TRUE, ...)
fisher.alpha(x, MARGIN = 1, se = FALSE, ...)
specnumber(x, groups, MARGIN = 1)
参数----------Arguments----------
参数:x
Community data, a matrix-like object or a vector.
社区数据,类似矩阵的目的或一个矢量。
参数:index
Diversity index, one of "shannon", "simpson" or "invsimpson".
多样性指数,"shannon","simpson"或"invsimpson"。
参数:MARGIN
Margin for which the index is computed.
该指数计算的保证金。
参数:base
The logarithm base used in shannon.
的对数base在shannon使用。
参数:sample
Subsample size for rarefying community, either a single value or a vector.
抽稀的社会,无论是单个值或一个向量的子样本的大小。
参数:se
Estimate standard errors.
参数:step
Step size for sample sizes in rarefaction curves.
步长,样本量稀疏曲线。
参数:xlab, ylab
Axis labels in plots of rarefaction curves.
轴标签在稀疏的曲线图。
参数:label
Label rarefaction curves by rownames of x (logical).
标签稀疏曲线x(逻辑)的行名。
参数:groups
A grouping factor: if given, finds the total number of species in each group.
分组的因素:如果给定的,发现各组的总种数的。
参数:...
Parameters passed to nlm, or to plot, lines and ordilabel in rarecurve.
参数传递nlm,或plot,lines和ordilabel中rarecurve。
Details
详细信息----------Details----------
Shannon or Shannon–Weaver (or Shannon–Wiener) index is defined as H = -sum p_i log(b) p_i, where p_i is the proportional abundance of species i and b is the base of the logarithm. It is most popular to use natural logarithms, but some argue for base b = 2 (which makes sense, but no real difference).
香,香农 - 韦弗(或多样性)指数定义为H = -sum p_i log(b) p_i,其中p_i的比例物种丰富度i和b是对数的底数。使用自然对数,这是最流行的,但有些人认为碱基b = 2(这是有道理的,但没有真正的区别)。
Both variants of Simpson's index are based on D = sum p_i^2. Choice simpson returns 1-D and invsimpson returns 1/D.
Simpson指数的两个变种的基础上D = sum p_i^2。选择simpson返回1-D和invsimpson回报1/D。
Function rarefy gives the expected species richness in random subsamples of size sample from the community. The size of sample should be smaller than total community size, but the function will silently work for larger sample as well and return non-rarefied species richness (and standard error = 0). If sample is a vector, rarefaction of all observations is performed for each sample size separately. Rarefaction can be performed only with genuine counts of individuals. The function rarefy is based on Hurlbert's (1971) formulation, and the standard errors on Heck et al. (1975).
函数rarefy给出了预期的在随机的大小sample子样本的物种丰富度社会。 sample的大小应该比总的社区规模小,但功能会默默的工作大sample的,返回非稀薄的物种丰富度(标准误= 0)。如果sample是一个向量,稀疏的所有观测值进行分别用于每个样品大小。可以仅执行稀薄个人有真正计数。的功能rarefy的基础上Hurlbert(1971)制定的标准误差哎呀等。 (1975)。
Function rrarefy generates one randomly rarefied community data frame or vector of given sample size. The sample can be a vector giving the sample sizes for each row, and its values must be less or equal to observed number of individuals. The random rarefaction is made without replacement so that the variance of rarefied communities is rather related to rarefaction proportion than to to the size of the sample.
功能rrarefy生成一个随机稀薄的社会给sample大小的数据框或向量。 sample提供的样本量为每行是一个矢量,其值必须小于或等于观察到的一些个人。的随机稀疏无需更换使稀薄社区的方差而有关的稀疏比例比的大小的sample。
Function drarefy returns probabilities that species occur in a rarefied community of size sample. The sample can be a vector giving the sample sizes for each row.
功能drarefy返回物种出现的概率在一个的稀薄社区的大小sample。 sample可以是一个向量,每一行的样本规模。
Function rarecurve draws a rarefaction curve for each row of the input data. The rarefaction curves are evaluated using the interval of step sample sizes, always including 1 and total sample size. If sample is specified, a vertical line is drawn at sample with horizontal lines for the rarefied species richnesses.
函数rarecurve绘制一个稀疏曲线的输入数据的每一行。使用的间隔step的样本量,总样本量和总稀疏曲线进行评估。如果sample指定,绘制一条垂直线,在sample的稀薄的物种richnesses的水平线。
fisher.alpha estimates the α parameter of Fisher's logarithmic series (see fisherfit). The estimation is possible only for genuine counts of individuals. The function can optionally return standard errors of α. These should be regarded only as rough indicators of the accuracy: the confidence limits of α are strongly non-symmetric and the standard errors cannot be used in Normal inference.
fisher.alpha估计的α参数Fisher的对数级数(见fisherfit“)。估计是可能的,只有真正的个人的罪名。该函数可以选择返回标准误差α。这些应被视为仅作为粗精度的指标:置信界限α具有很强的非对称的和标准的误差不能被用于在正常推理。
Function specnumber finds the number of species. With MARGIN = 2, it finds frequencies of species. If groups is given, finds the total number of species in each group (see example on finding one kind of beta diversity with this option).
函数specnumber发现的物种数量。随着MARGIN = 2,它发现物种的频率。如果groups,发现总种数的各组(例如,使用此选项找到一个beta多样性)。
Better stories can be told about Simpson's index than about Shannon's index, and still grander narratives about rarefaction (Hurlbert 1971). However, these indices are all very closely related (Hill 1973), and there is no reason to despise one more than others (but if you are a graduate student, don't drag me in, but obey your Professor's orders). In particular, the exponent of the Shannon index is linearly related to inverse Simpson (Hill 1973) although the former may be more sensitive to rare species. Moreover, inverse Simpson is asymptotically equal to rarefied species richness in sample of two individuals, and Fisher's α is very similar to inverse Simpson.
值----------Value----------
A vector of diversity indices or rarefied species richness values. With a single sample and se = TRUE, function rarefy returns a 2-row matrix with rarefied richness (S) and its standard error (se). If sample is a vector in rarefy, the function returns a matrix with a column for each sample size, and if se = TRUE, rarefied richness and its standard error are on consecutive lines.
多样性指数或稀薄的物种丰富度值的矢量。通过一个单一的sample和se = TRUE,功能rarefy返回一个2行矩阵稀薄的丰富度(S)及其标准误(se)的。如果sample是一个向量在rarefy,该函数返回一个矩阵,一列每个sample大小,如果se = TRUE,,稀薄丰富,其标准错误是在连续线。
Function rarecurve returns invisible list of rarefy results corresponding each drawn curve.
功能rarecurve返回invisible rarefy相应的每个绘制曲线的结果列表。
With option se = TRUE, function fisher.alpha returns a data frame with items for α (alpha), its approximate standard errors (se), residual degrees of freedom (df.residual), and the code returned by nlm on the success of estimation.
选项“se = TRUE,函数fisher.alpha返回一个数据框项目α(alpha),其近似的标准误(se),剩余的自由度(df.residual),和code的返回nlm估计的成功。
----------Author(s)----------
Jari Oksanen and Bob O'Hara (<code>fisher.alpha</code>).
参考文献----------References----------
between the number of species and the number of individuals in a random sample of animal population. Journal of Animal Ecology <STRONG>12</STRONG>, 42–58.
calculation of the rarefaction diversity measurement and the determination of sufficient sample size. Ecology <STRONG>56</STRONG>, 1459–1461.
and alternative parameters. Ecology <STRONG>52</STRONG>, 577–586.
参见----------See Also----------
Function renyi for generalized R茅nyi
功能renyi广义仁义
实例----------Examples----------
data(BCI)
H <- diversity(BCI)
simp <- diversity(BCI, "simpson")
invsimp <- diversity(BCI, "inv")
## Unbiased Simpson of Hurlbert 1971 (eq. 5):[#偏辛普森的Hurlbert 1971年(公式5):]
unbias.simp <- rarefy(BCI, 2) - 1
## Fisher alpha[#费舍尔阿尔法]
alpha <- fisher.alpha(BCI)
## Plot all[#图全部]
pairs(cbind(H, simp, invsimp, unbias.simp, alpha), pch="+", col="blue")
## Species richness (S) and Pielou's evenness (J):[#物种丰富度(S)和均匀度的均匀度(J):]
S <- specnumber(BCI) ## rowSums(BCI > 0) does the same...[:#rowSums(BCI> 0)做同样的...]
J <- H/log(S)
## beta diversity defined as gamma/alpha - 1:[#beta多样性定义为γ/α - 1:]
data(dune)
data(dune.env)
alpha <- with(dune.env, tapply(specnumber(dune), Management, mean))
gamma <- with(dune.env, specnumber(dune, Management))
gamma/alpha - 1
## Rarefaction[#稀薄]
(raremax <- min(rowSums(BCI)))
Srare <- rarefy(BCI, raremax)
plot(S, Srare, xlab = "Observed No. of Species", ylab = "Rarefied No. of Species")
abline(0, 1)
rarecurve(BCI, step = 20, sample = raremax, col = "blue", cex = 0.6)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|