回答:任一列中的单个 NA 值都data.frame
可能导致此错误。
我有一个相当令人沮丧的问题需要帮助。我正在尝试在 R 中运行 permanova,并且我正在使用adonis()
Vegan 来执行此操作。我有一个按样本的物种data.frame
,249 行 x 16 列(物种名称为column.names
),以及一个单独data.frame
的 249 行 x 3 列,包含我的环境协变量。我使用下面的代码来运行它,我得到了上面的错误。我在一些非常非常相似的数据上运行 adonis 没有问题,我不确定这次出了什么问题。
有什么建议么?万分感谢。
代码
SpeciesADONIS <- adonis(ScreenedSpeciesbySample ~ AvgSalinity + AvgTurbidity +
AvgDO + AvgSalinity * AvgTurbidity + AvgSalinity*AvgDO +
AvgTurbidity * AvgDO,
data = RegPhysDriversTimeSeries2,
permutations=999, method="bray")
样品头的物种(使用创建dput
)
ScreenedSpeciesbySample <-
structure(list(
"Gulf menhaden" = c(0.05, 0.05, 0.01, 0.02, 0.00471, 0.01),
"Hardhead catfish" = c(0, 0, 0, 0.26, 0.00107, 0.04),
"White shrimp" = c(0.00298, 9.2e-06, 0.04, 0.13, 0.36, 0.01),
"Atlantic croaker" = c(0.01, 0.14, 0.44, 0.25, 0.08, 0.05),
"Black drum" = c(0, 0, 0, 0.12, 0, 0),
"Gafftopsail catfish" = c(0, 0, 0, 0, 0, 0),
"Striped mullet" = c(0.46, 0, 0, 0, 0, 0),
"Brown shrimp" = c(0, 0, 0, 0, 0.32, 0.04),
"Spotted seatrout" = c(0, 0, 0, 0, 0, 0),
"Spot" = c(0.11, 0.41, 3.02e-05, 0.02, 0.00021, 0.00271),
"Gizzard shad" = c(0, 0.17, 0, 0, 0, 0),
"Red drum" = c(0, 0, 0, 0, 0, 0),
"Bay anchovy" = c(0.00164, 0, 0, 0, 0.000127, 8.84e-05),
"Atlantic cutlassfish" = c(0, 0, 0, 0, 0.01, 0.49),
"Sand seatrout" = c(0, 0, 0, 0.04, 0.03, 0),
"Blue crab" = c(494.27, 583.35, 705.43, 476.09, 3103.18, 1699.67)),
.Names = c("Gulf menhaden",
"Hardhead catfish", "White shrimp", "Atlantic croaker", "Black drum",
"Gafftopsail catfish", "Striped mullet", "Brown shrimp", "Spotted seatrout",
"Spot", "Gizzard shad", "Red drum", "Bay anchovy", "Atlantic cutlassfish",
"Sand seatrout", "Blue crab"),
row.names = c(NA, 6L),
class = "data.frame")
物理协变量头(使用创建dput
)
RegPhysDriversTimeSeries2 <-
structure(list(
AvgSalinity = c(14.88, 14.84, 5.7, 4.8, 9.5, 11.41),
AvgTurbidity = c(29.5, 53.53, 109.71, 109.48, 73.69, 39.37),
AvgDO = c(11.19, 8.18, 8.37, 14.39, 10.61, 7.94)),
.Names = c("AvgSalinity", "AvgTurbidity", "AvgDO"),
row.names = c(NA, 6L),
class = "data.frame")