我正在尝试生成一个类似于此的简单图条形图(gamma)然而,我遇到了错误:
"Error in if (s2 < 0) s2 <- 0 : missing value where TRUE/FALSE needed"
紧随其后:
In addition: Warning messages:
1: In model.matrix.default(mt, mf, contrasts) :
non-list contrasts argument ignored
2: In max(dist, na.rm = TRUE) :
no non-missing arguments to max; returning -Inf
我的代码是基于一个数据集,以前没有给我任何问题,直到现在。
data_distance_GL <- data_plasto %>%
filter(method == "Line Transect",
species == "GL") %>%
select(observer, method, species, distance)
detectability_GL <- dfuncEstim(distance ~ 1,
detectionData = data_distance_GL,
likelihood = "Gamma")
plot(detectability_GL)
问题出现在第二段代码中。知道是怎么回事吗?
也许你正在尝试写作?
if_else(s2 < 0, 0, s2)