简体   繁体   English

term.formula 数据参数无效

[英]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 .这意味着您要么以formuladata的形式提供输入,要么以XYZ的形式提供输入。

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.

相关问题 在带有公式参数的函数中的R if语句 - R if statement in a function with a fomula argument term.formula(formula) 中的错误:&#39;.&#39; 在公式中,没有“数据”参数 - Error in terms.formula(formula) : '.' in formula and no 'data' argument 公式中的错误。(公式,数据=数据):公式中的无效功效 - Error in terms.formula(formula, data = data) : invalid power in formula dim(data) &lt;- dim 中的错误:第一个参数无效 - Error in dim(data) <- dim : invalid first argument 在R中应用BMA软件包时:terms.formula(公式,特殊,数据=数据)中的错误:“。” 在公式中,没有“数据”参数 - when applying the BMA packages in R : Error in terms.formula(formula, special, data = data) : '.' in formula and no 'data' argument “terms.formula(公式,数据=数据)中的错误:'。' 在公式中,在老鼠的“with()”中没有“数据”参数”function - "Error in terms.formula(formula, data = data) : '.' in formula and no 'data' argument" within mice's "with()" function 脚本无法运行(terms.formula(formula,data = data)中的错误:&#39;data&#39;参数的类型错误 - Script won't run (Error in terms.formula(formula, data = data) : 'data' argument is of the wrong type r 语言问题:terms.formula(formula, data = data): '.' 中的错误在公式中,没有“数据”参数 - r language question: Error in terms.formula(formula, data = data) : '.' in formula and no 'data' argument 当对 kNN 使用 `caret` 时,我得到“错误 in terms.formula(formula, data = data): '.' 在公式中,没有“数据”参数” - When using `caret` for kNN, I get “Error in terms.formula(formula, data = data) : '.' in formula and no 'data' argument” LM无法正常工作(ExtractVars中的模型公式无效(terms.formula(formula,data = data)中的错误) - LM not working (Error in terms.formula(formula, data = data) invalid model formula in ExtractVars
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM