[英]terms.fomula data argument invalid
I am new to R Studio and now want to make a "cca".我是 R Studio 的新手,现在想制作一个“cca”。 I followed a describtion but R says NO.
我遵循了描述,但 R 说不。 This is what Iam working with:
这就是我正在使用的:
PreAbscca<- read.table("PreAbsenz.csv", header = TRUE, row.names = NULL)
UVcca<- read.table("UV.csv", header = TRUE, row.names = 1)
cca.all<- cca ( PreAbscca, UVcca )
UVcca are the Environmental Variables like Tree class, Tree diameter, altitude, cover %.. Tree class was numeric so I changed the type of tree in 1,2,3 because I thought it would chance something and would work, but it does not. UVcca 是环境变量,如树类、树直径、高度、覆盖率 %.. 树类是数字,所以我在 1、2、3 中更改了树的类型,因为我认为它会发生一些事情并且会起作用,但它没有. PreAbscca inclued the incidence of bryophyts.
PreAbscca 包括苔藓植物的发生率。 If they appear on the trees yes(1) or no (0).
如果它们出现在树上,是 (1) 或否 (0)。 In The List are just numbers.
在列表中只是数字。
And R puts out this error: R 抛出了这个错误:
Error in terms.formula ( object, data = data ) : '.'
term.formula 中的错误(对象,数据 = 数据):'.' appears in the formula and 'data' argument is not valid
出现在公式中并且“数据”参数无效
What can I do, maybe someone can help me this would be nice.我能做什么,也许有人可以帮助我这会很好。 Thank u for that
谢谢你
Unfortunately your example is not reproducible so I can't test this for myself.不幸的是,您的示例无法重现,因此我无法亲自测试。
From the error message it seems your input for the cca
function is wrong.从错误消息看来,您对
cca
函数的输入是错误的。 It is not exactly clear, which package your are using, but I am assuming you are using cca
from the vegan
package.目前尚不清楚您使用的是哪个软件包,但我假设您正在使用
vegan
软件包中的cca
。
The package documentation says about the usage of this function:包文档说明了这个函数的用法:
"cca"(formula, data, na.action = na.fail, subset = NULL, ...) "cca"(X, Y, Z, ...)
Which means you either supply input in the form of formula
and data
or in the form of X
, Y
, Z
.这意味着您要么以
formula
和data
的形式提供输入,要么以X
、 Y
、 Z
的形式提供输入。
Here what these inputs need to be:这些输入需要是什么:
formula Model formula, where the left hand side gives the community data matrix, right hand side gives the constraining variables, and conditioning variables can be given within a special function Condition.
公式模型公式,其中左侧给出社区数据矩阵,右侧给出约束变量,条件变量可以在一个特殊的函数条件下给出。 data
数据
data Data frame containing the variables on the right hand side of the model formula.
data包含模型公式右侧变量的数据框。
So in this cas you need supply formula and a data.frame.所以在这个 cas 你需要提供公式和一个 data.frame。
X Community data matrix.
X社区数据矩阵。
Y Constraining matrix, typically of environmental variables.
Y约束矩阵,通常是环境变量。 Can be missing.
可以失踪。 It is better to use formula instead of this argument, and some further analyses only work when formula was used.
最好使用公式而不是这个参数,一些进一步的分析只有在使用公式时才有效。
Z Conditioning matrix, the effect of which is removed (`partialled out') before next step.
Z条件矩阵,其影响在下一步之前被移除(`partialed out')。 Can be missing.
可以失踪。
It seems like these need to be supplies as a matrix似乎这些需要作为矩阵供应
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.