找回密码
 注册
查看: 1163|回复: 0

R语言 vegan包 envfit()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 15:06:16 | 显示全部楼层 |阅读模式
envfit(vegan)
envfit()所属R语言包:vegan

                                        Fits an Environmental Vector or Factor onto an Ordination
                                         适合环境的向量或因子上的协调

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

The function fits environmental vectors or factors onto an ordination. The projections of points onto vectors have maximum correlation with corresponding environmental variables, and the factors show the averages of factor levels.
该功能适用到一个协调的环境媒介或因素。预测点到向量与相应的环境变量,有最大的相关性的因素表明因子水平的平均值。


用法----------Usage----------


## Default S3 method:[默认方法]
envfit(ord, env, permutations = 999, strata, choices=c(1,2),
   display = "sites", w  = weights(ord), na.rm = FALSE, ...)
## S3 method for class 'formula'[类formula的方法]
envfit(formula, data, ...)
## S3 method for class 'envfit'
plot(x, choices = c(1,2), arrow.mul, at = c(0,0), axis = FALSE,
    p.max = NULL, col = "blue", bg, add = TRUE, ...)
## S3 method for class 'envfit'
scores(x, display, choices, ...)
vectorfit(X, P, permutations = 0, strata, w, ...)
factorfit(X, P, permutations = 0, strata, w, ...)



参数----------Arguments----------

参数:ord
An ordination object or other structure from which the ordination scores can be extracted (including a data frame or matrix of scores).
一个的协调对象或其他结构的协调scores可以提取(包括一个数据框或矩阵的分数)。


参数:env
Data frame, matrix or vector of environmental variables. The variables can be of mixed type (factors, continuous variables) in data frames.
数据框,矩阵或向量的环境变量。变量可以是混合型(因素的影响,连续变量)的数据框。


参数:X
Matrix or data frame of ordination scores.
矩阵或数据框的协调的分数。


参数:P
Data frame, matrix or vector of environmental variable(s). These must be continuous for vectorfit and factors or characters for factorfit.  
数据框,矩阵或向量的环境变量(S)。这些vectorfit和因素或字符的factorfit必须是连续的。


参数:permutations
Number of permutations for assessing significance of vectors or factors. Set to 0 to skip permutations.
评估向量或因素的意义的排列数。设置为0跳过排列。


参数:formula, data
Model  formula and data.   
型号formula和数据。


参数:na.rm
Remove points with missing values in ordination scores or environmental variables. The operation is casewise: the whole row of data is removed if there is a missing value and  na.rm = TRUE.
删除与协调分数或环境变量的遗漏值的点。的操作是观察值:如果有缺失值和na.rm = TRUE整行数据被删除。


参数:x
A result object from envfit.
一个结果对象从envfit。


参数:choices
Axes to plotted.
轴标绘。


参数:arrow.mul
Multiplier for vector lengths. The arrows are automatically scaled similarly as in plot.cca if this is not given and add = TRUE.
乘数向量的长度。中的箭头自动缩放同样plot.cca如果没有给出和add = TRUE。


参数:at
The origin of fitted arrows in the plot.  If you plot arrows in other places then origin, you probably have to specify arrrow.mul.
原产地装箭的图。如果您在其他地方图箭头,然后起源,你可能必须指定arrrow.mul。


参数:axis
Plot axis showing the scaling of fitted arrows.
图轴装箭的缩放比例。


参数:p.max
Maximum estimated P value for displayed variables.  You must calculate P values with setting permutations to use this option.  
最高估计P显示的变量值。你必须计算P设置permutations使用此选项的值。


参数:col
Colour in plotting.
在绘制的颜色。


参数:bg
Background colour for labels. If bg is set, the labels are displayed with ordilabel instead of text. See Examples for using semitransparent background.
背景颜色的标签。如果bg被设置,的标签显示ordilabel,而不是text,。示例,请参见使用半透明背景下的。


参数:add
Results added to an existing ordination plot.
结果添加到现有的排序图。


参数:strata
An integer vector or factor specifying the strata for permutation. If supplied, observations are permuted only within the specified strata.
一个整数向量或因素确定地层的置换。如果提供,观测置换仅在指定的阶层。


参数:display
In fitting functions these are ordinary site scores or linear combination scores  ("lc") in constrained ordination (cca, rda, capscale). In scores function they are either "vectors" or "factors" (with synonyms "bp" or "cn", resp.).
在拟合函数,这些都是普通的网站分数或线性组合分数("lc")在约束统筹(cca,rda,capscale)。在scores其所在的部门是"vectors"或"factors"(的同义词"bp"或"cn",分别为)。


参数:w
Weights used in fitting (concerns mainly cca and decorana results which have nonconstant weights).
在装修中使用的重量(涉及主要的cca和decorana结果有非常数的权重)。


参数:...
Parameters passed to scores.
参数传递到scores。


Details

详细信息----------Details----------

Function envfit finds vectors or factor averages of environmental variables.  Function plot.envfit adds these in an ordination diagram.  If X is a data.frame, envfit uses factorfit for factor variables and vectorfit for other variables.  If X is a matrix or a vector, envfit uses only vectorfit. Alternatively, the model can be defined a simplified model formula, where the left hand side must be an ordination result object or a matrix of ordination scores, and right hand side lists the environmental variables. The formula interface can be used for easier selection and/or transformation of environmental variables. Only the main effects will be analysed even if interaction terms were defined in the formula.
函数envfit发现环境变量的向量或因子的平均值。函数plot.envfit增加了这些在排序图。如果X是一个data.frame,envfit使用factorfitfactor变量和vectorfit其他变量,。 X如果是一个矩阵或向量,envfit只使用vectorfit。或者,该模型可以定义一个简化的模型formula,左手侧必须是一个协调结果对象或协调分数的矩阵,和右侧列出了环境变量。可用于更容易的选择和/或改造环境变量的公式接口。只有将分析的主要影响,即使交互项中定义的公式。

The printed output of continuous variables (vectors) gives the direction cosines which are the coordinates of the heads of unit length vectors.  In plot these are scaled by their correlation (square root of the column r2) so that “weak” predictors have shorter arrows than “strong” predictors.  You can see the scaled relative lengths using command scores.  The plotted (and scaled) arrows are further adjusted to the current graph using a constant multiplier: this will keep the relative r2-scaled lengths of the arrows but tries to fill the current plot.  You can see the multiplier using vegan::rdiArrowMul(result_of_envfit), and set it with the argument arrow.mul.
连续变量的打印输出(向量)给出的坐标单位长度的矢量的头的方向余弦。在plot这些都是他们的相关(平方根的列缩放r2),“弱”的预测更短的箭头比“强”的预测。你可以看到使用命令scores的规模相对长度。 plot的TED(和缩放)箭头进一步调整到当前图形中使用恒定的倍增器:这将保持相对r2规模的长度的箭头,但,试图填补目前积。你可以看到乘数使用vegan::rdiArrowMul(result_of_envfit),并设置它的参数arrow.mul。

Functions vectorfit and factorfit can be called directly. Function vectorfit finds directions in the ordination space towards which the environmental vectors change most rapidly and to which they have maximal correlations with the ordination configuration.  Function factorfit finds averages of ordination scores for factor levels. Function factorfit treats ordered and unordered factors similarly.
功能vectorfit和factorfit可以直接调用。功能vectorfit找到方向向环境媒介变化最迅速的,他们具有极大的相关性与协调配置在协调空间。函数factorfit发现因子水平的协调分数的平均值。功能factorfit亲切有序和无序的因素同样。

If permutations > 0, the "significance" of fitted vectors or factors is assessed using permutation of environmental variables. The goodness of fit statistic is squared correlation coefficient (r^2). For factors this is defined as r^2 = 1 - ss_w/ss_t, where ss_w and ss_t are within-group and total sums of squares. See permutations for additional details on permutation tests in Vegan.
如果permutations> 0,“意义”合身的向量或因素进行评估使用的环境变量排列。善良的拟合统计的相关系数平方(r^2)的。因素,这被定义为r^2 = 1 - ss_w/ss_t,其中ss_w和ss_t是组内,总平方和。见permutations排列测试,素食主义者的更多细节。

User can supply a vector of prior  weights w. If the ordination object has weights, these will be used. In practise this means that the row totals are used as weights with cca or decorana results. If you do not like this, but want to give  equal weights to all sites, you should set w = NULL. The weighted fitting gives similar results to biplot arrows and class centroids in cca. For complete similarity between fitted vectors and biplot arrows, you should set display = "lc" (and possibly scaling = 2).
用户可以提供前的权重向量的w。如果协调对象的权重,这些将被使用。在实践中,这意味着该行总计cca或decorana结果作为权重。如果你不喜欢这个,但要给予相同的权重,所有的网站,你应该设置w = NULL。加权拟合给出了类似的结果中的的双标图箭头和类质心cca。对于合适的向量和双标图箭头之间的相似性,你应该设置display = "lc"(也可能是scaling = 2)。

The lengths of arrows for fitted vectors are automatically adjusted for the physical size of the plot, and the arrow lengths cannot be compared across plots. For similar scaling of arrows, you must explicitly set the arrow.mul argument in the plot command.
装矢量箭头的长度自动调整图形大小的物理,整个图的箭头长度不能比拟的。类似的缩放的箭头,你必须明确地设置arrow.mul参数plot命令。

The results can be accessed with scores.envfit function which returns either the fitted vectors scaled by correlation coefficient or the centroids of the fitted environmental variables.
结果可以访问scores.envfit函数返回通过相关系数或拟合的环境变量的重心缩放拟合向量。


值----------Value----------

Functions vectorfit and factorfit return lists of classes vectorfit and factorfit which have a print method.  The result object have the following items:
功能vectorfit和factorfit返回列表的类vectorfit和factorfit有一个print方法。结果对象有以下项目:


参数:arrows
Arrow endpoints from vectorfit. The arrows are scaled to unit length.
箭头端点从vectorfit。箭头缩放到单位长度。


参数:centroids
Class centroids from factorfit.
类质心从factorfit。


参数:r
Goodness of fit statistic: Squared correlation coefficient
善良的拟合统计:平方相关系数


参数:permutations
Number of permutations.
的排列数目。


参数:pvals
Empirical P-values for each variable.
实证P-每个变量的值。

Function envfit returns a list of class envfit with results of vectorfit and envfit as items.
功能envfit返回一个列表类envfitvectorfit和envfit作为项目的结果。

Function plot.envfit scales the vectors by correlation.
功能plot.envfit尺度的向量由相关。


注意----------Note----------

Fitted vectors have become the method of choice in displaying environmental variables in ordination.  Indeed, they are the optimal way of presenting environmental variables in Constrained Correspondence Analysis cca, since there they are the linear constraints. In unconstrained ordination the relation between external variables and ordination configuration may be less linear, and therefore other methods than arrows may be more useful.  The simplest is to adjust the plotting symbol sizes (cex, symbols) by environmental variables. Fancier methods involve smoothing and regression methods that abound in R, and ordisurf provides a wrapper for some.
合身的向量已成为显示环境变量的协调方法的选择。事实上,他们提出环境变量的约束对应分析cca,因为他们是线性约束的最佳方式。在无约束的协调,外部变量和协调配置之间的关系可能是线性较差,因此比其他方法箭头可能会更有益。最简单的方法是调整绘图符号大小(cex,symbols)的环境变量。票友方法涉及平滑和回归分析的方法比比皆是,在研发和ordisurf提供了一个包装为一些。


(作者)----------Author(s)----------


Jari Oksanen.  The permutation test derives from the code
suggested by Michael Scroggie.



参见----------See Also----------

A better alternative to vectors may be ordisurf.   
可能是一个更好的替代向量ordisurf。


实例----------Examples----------


data(varespec)
data(varechem)
library(MASS)
ord <- metaMDS(varespec)
(fit <- envfit(ord, varechem, perm = 999))
scores(fit, "vectors")
plot(ord)
plot(fit)
plot(fit, p.max = 0.05, col = "red")
## Adding fitted arrows to CCA. We use "lc" scores, and hope[#添加合身的箭头,CCA。我们使用“LC”的成绩,并希望]
## that arrows are scaled similarly in cca and envfit plots[#同样CCA和envfit的图缩放,箭头]
ord <- cca(varespec ~ Al + P + K, varechem)
plot(ord, type="p")
fit <- envfit(ord, varechem, perm = 999, display = "lc")
plot(fit, p.max = 0.05, col = "red")
## Class variables, formula interface, and displaying the[#类变量,式界面,并显示该]
## inter-class variability with `ordispider', and semitransparent[#与的ordispider“,和半透明的类间变化]
## white background for labels (semitransparent colours are not[#背景为白色标签(半透明颜色不]
## supported by all graphics devices)[#所有图形设备的支持)]
data(dune)
data(dune.env)
attach(dune.env)
ord <- cca(dune)
fit <- envfit(ord ~ Moisture + A1, dune.env, perm = 0)
plot(ord, type = "n")
ordispider(ord, Moisture, col="skyblue")
points(ord, display = "sites", col = as.numeric(Moisture), pch=16)
plot(fit, cex=1.2, axis=TRUE, bg = rgb(1, 1, 1, 0.5))

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-27 02:36 , Processed in 0.102213 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表