首页 > 解决方案 > NA富包问题的物种富集

问题描述

我需要计算一个名为 riquesa1 的数据框的物种丰富度,它由 13 个变量(物种)和 59 个观察值(每个物种在整个样本中的频率)组成。我正在使用 Rich 包中的丰富功能和以下代码:

rich(matrix = riquesa1, verbose = FALSE, nrandom = NULL)

但是,当我运行该函数时,出现此错误:

Error in if (S[is] == 0) next : missing value where TRUE/FALSE needed

我想这可能是由于 Na 存在于数据框中,但我不确定。我该如何解决?

提前致谢!!

标签: rna

解决方案


reconstruct <- structure(list(`Amphora lybica` = c(NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Amphora spp.` = c(0.405, NA, 0.127, NA, NA), `Cocconeis placentula` = c(NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Cyclotella ocellata` = c(NA, NA, NA, NA, 0.0606), `C. distinguenda complex` = c(NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Diploneis ovalis` = c(NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Encyonopsis subminuta` = c(NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Encyonopsis caespitosa` = c(NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Hantzschia amphioxus` = c(NA, 0.187, 0.08, NA, NA), `Luticula mutica` = c(NA, 0.283, 0.163, NA, NA), `Mastogloia smithii` = c(NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Mastogloia spp.` = c(0.092, NA, NA, NA, NA), `Pseudostaurosira brevistriata` = c(0.428, 0.063, 0.331, 0.964, 0.798)), row.names = c(NA, -5L), class = c("tbl_df", "tbl", "data.frame"))


推荐阅读