r - 尝试拟合混合混合模型时 secr.fit 的错误“FUN 中的错误(X[[i]],...):”
问题描述
在考虑了小插曲和在论坛上搜索后,我无法解决以下错误。
我正在使用 R 中的包 secr(由 Murray Efford 开发)进行多会话分析。
当我运行这个模型时
fit_age0 <- secr.fit(bothCH, mask = mask, detectfn = 2, trace = F, hcov = 'age')
我收到这个错误
FUN(X[[i]], ...) 中的错误:当第一天没有使用第一个检测器时,混合模型失败。
用于创建相关 capthist 文件的代码如下。如果我知道具体问题出在哪里,我会进一步减少这一点。请让我知道是否需要其他信息来帮助回答此问题。
library(secr)
library(RColorBrewer)
library(sp)
library(rgdal)
library(GISTools)
library(raster)
library(readxl)
#--------------------
###Input files and create capthist####
captfile <- "captfile_both.xlsx"
trapfile <- "trapfile_both.csv"
suggest.buffer(bothCH)
#########
#276 395#
#########
# quick and biased estimate of sigma (metres)
initialsigma_both <- RPSV(bothCH, CC = TRUE)
initialsigma_both
##############
#$`OUT` #
#[1] 85.34081#
# #
#$IN #
#[1] 118.8134#
##############
buffer <- 800
bothCH <- read.capthist(captfile = captfile, trapfile = trapfile,
skip = 1, detector = "proximity",
covnames = c("age"))
bothCH <- split(bothCH, grepl('IN',rownames(traps(bothCH))), bytrap = TRUE)
# drop last 2 occasions for OUT (no cameras working)
bothCH[[1]] <- subset(bothCH[[1]], occasions=1:78)
usage(traps(bothCH[[1]])) <- usage(traps(bothCH[[1]]))[,1:78]
#### Clear repeat observations
bothCH <- reduce(bothCH, dropunused = FALSE)
verify(bothCH)
session(bothCH) <- c('OUT',"IN")
下面是我的陷阱文件和 capt 文件布局的示例。
提前感谢您的任何建议,因为我真的很难完成这项分析。
解决方案
推荐阅读
- reactjs - 设置 domLayout = 'autoHeight' 使浏览器崩溃
- php - 无法在 symfony 4 中将参数传递给树枝模板
- c# - INSERT 语句与 FOREIGN KEY 约束“FK_Employees_Departments”冲突
- ansible - Ansible 2.7 include_tasks 不再接受变量
- webpack - 使用 Webpack 构建和缩小 LESS 文件并缩小 JS 文件
- android - 在android中将GBoard数字键盘显示为默认值,并可选择切换到左下角的字母键盘
- apache-spark - 同一个 Spark 操作的不同解释计划
- .net-core - Azure AD OAuth 2 验证令牌 .NET Core
- git - 智能 git stash 和 rebase
- java - 使用应用程序发送 HTTP 请求 - AndroidStudio