我使用素食社区生态包在 R 中执行了“基于距离的冗余分析”(dbRDA)。我想在 dbRDA 结果的排序图中显示(鱼)营养组对样本之间差异(营养级鱼类组合的丰度数据)的相对贡献。即在排序图上叠加箭头和营养级组名称,其中箭头线的长度表示对差异的相对贡献。据我了解,这应该可以通过vegan::scores()
函数访问,或者与dbrda.model$CCA$v
对象一起存储。
但是,当使用 时,物种分数是空的 (NA) dbrda()
。我知道 dbrda 函数需要在函数中定义社区矩阵才能提供物种分数。我已将其定义为这样,但仍然无法产生物种分数。令我困惑的是,当我capscale()
在 vegan 包中使用相同的物种群落和环境变量数据,并在各自的函数中制定相同的公式时,会产生物种分数。dbrda
素食主义者能够产生物种分数吗?这些分数与由capscale
(当使用相同的数据和公式时)?我提供了我的数据示例和使用的公式。(我对实际绘制一旦获得的物种分数很有信心 - 所以将代码限制为产生物种分数。)
#Community data matrix (comm.dat): site names = row names, trophic level = column names
>head(comm.dat[1:5,1:4])
algae/invertebrates corallivore generalist carnivore herbivore
h_m_r_3m_18 1 0 3 0
h_m_r_3m_22 6 4 8 26
h_m_r_3s_19 0 0 4 0
h_m_r_3s_21 3 0 7 0
l_pm_r_2d_7 1 0 5 0
> str(comm.dat)
num [1:47, 1:8] 1 6 0 3 1 8 11 2 6 9 ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:47] "h_m_r_3m_18" "h_m_r_3m_22" "h_m_r_3s_19" "h_m_r_3s_21" ...
..$ : chr [1:8] "algae/invertebrates" "corallivore" "generalist carnivore" "herbivore" ...
# environmental data (env.dat): Already standardised env data.
>head(env.dat[1:5,1:3])
depth water.level time.in
-0.06017376 1.3044232 -1.7184415
-0.67902862 1.3044232 -1.7907181
-0.99619174 1.3044232 -1.7569890
-1.06581291 1.3044232 -1.7762628
2.39203863 -0.9214933 0.1703884
# Dissimilarity distance: Modified Gower (AltGower) with logbase 10 transformation of the community data matrix
> dis.comm.mGow <- vegan::vegdist(x = decostand(comm.dat, "log", logbase = 10), method = "altGower")
# Distance based RDA model: Trophic level data logbase transformed modified Gower distance, constrained against the interaction of dept and water level (tide), and the interaction of depth and time of day sampled`
> m.dbrda <- dbrda(formula = dis.comm.mGow ~ depth*water.level + depth*time.in, data = env.dat, scaling = 2, add = "lingoes", comm = decostand(comm.dat, "log", logbase = 10), dfun = "altGower")
# Check species scores: PROBLEM: No species level scores available
> m.dbrda$CCA$v
dbRDA1 dbRDA2 dbRDA3 dbRDA4 dbRDA5
[1,] NA NA NA NA NA
# OR pull species scores using scores(): Also does not show species scores...
>scrs <- scores(m.dbrda,display="species"); scrs
dbRDA1 dbRDA2
spe1 NA NA
attr(,"const")
[1] 6.829551
# when replacing dbrda with capscale, species scores are produced, e.g.
> m.cap <- capscale(formula = dis.comm.mGow ~ depth*water.level + depth*time.in, data = env.dat, scaling = 2, add = "lingoes", comm = decostand(comm.dat, "log", logbase = 10), dfun = "altGower")
> m.cap$CCA$v[1:5,1:3]
CAP1 CAP2 CAP3
algae/invertebrates 0.2044097 -0.04598088 -0.37200097
corallivore 0.3832594 0.06416886 -0.27963122
generalist carnivore 0.1357668 -0.08566365 -0.06789812
herbivore 0.5745226 -0.45647341 0.73085661
invertebrate carnivore 0.1987651 0.68036211 -0.19174283