我想使用素食主义者在R中执行rda.
我的代码看起来像这样:
species<- read.delim("springspecies1.txt", header=T)
envdata<- read.delim("springenv1.txt", header=T)
RDA <- rda(species~Temperature + Salinity + O2 + Phosphate + Nitrate + Silica, envdata, scale=T, na.action=na.omit)
Run Code Online (Sandbox Code Playgroud)
我收到错误信息:
Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric
Run Code Online (Sandbox Code Playgroud)
当我检查我的数据时,我得到:
sapply(species, mode)
Station Year Month S.marinoi C.tripos
"numeric" "numeric" "numeric" "numeric" "numeric"
P.alata P.seriata R.setigera C.pelagica D.confervacea
"numeric" "numeric" "numeric" "numeric" "numeric"
C.decipiens P.farcimen C.furca
"numeric" "numeric" "numeric"
Run Code Online (Sandbox Code Playgroud)
我的数据集中没有NA或空格.但似乎物种数据集是问题所在.我用物种编译了一个新的数据集,但我又遇到了同样的问题.有任何想法吗?
我使用纯素包在R中进行了规范的对应分析,但我发现输出很难理解.triplot是可以理解的,但是我从摘要中得到的所有数字(cca)都让我感到困惑(因为我刚开始学习圣职任命技术)我想知道Y中的多少方差是由X(在这种情况下,环境变量)以及哪个独立变量在此模型中很重要?
我的输出看起来像这样:
Partitioning of mean squared contingency coefficient:
Inertia Proportion
Total 4.151 1.0000
Constrained 1.705 0.4109
Unconstrained 2.445 0.5891
Eigenvalues, and their contribution to the mean squared contingency coefficient
Importance of components:
CCA1 CCA2 CCA3 CCA4 CCA5 CCA6 CCA7
Eigenvalue 0.6587 0.4680 0.34881 0.17690 0.03021 0.02257 0.0002014
Proportion Explained 0.1587 0.1127 0.08404 0.04262 0.00728 0.00544 0.0000500
Cumulative Proportion 0.1587 0.2714 0.35548 0.39810 0.40538 0.41081 0.4108600
CA1 CA2 CA3 CA4 CA5 CA6 CA7
Eigenvalue 0.7434 0.6008 0.36668 0.33403 0.28447 0.09554 0.02041 …Run Code Online (Sandbox Code Playgroud)