答案:data.frame
中任意列中的单个NA值都可能导致此错误。
我有一个相当令人沮丧的问题,我需要帮助。我正试图在R中运行一个permanova,而我在素食主义者中使用adonis()
来做到这一点。我有一个样本data.frame
,249行16列(物种名称为column.names
),以及249行3列的单独data.frame
,包含我的环境协变量。我正在使用下面的代码运行它,我得到上面的错误。我在一些非常非常相似的数据上运行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")