aboutsummaryrefslogtreecommitdiff
path: root/R/mhmkin.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/mhmkin.R')
-rw-r--r--R/mhmkin.R5
1 files changed, 4 insertions, 1 deletions
diff --git a/R/mhmkin.R b/R/mhmkin.R
index 61d67204..b72ae318 100644
--- a/R/mhmkin.R
+++ b/R/mhmkin.R
@@ -177,7 +177,10 @@ AIC.mhmkin <- function(object, ..., k = 2) {
#' @export
BIC.mhmkin <- function(object, ...) {
- res <- sapply(object, function(x) BIC(x$so))
+ res <- sapply(object, function(x) {
+ if (inherits(x, "try-error")) return(NA)
+ else return(BIC(x$so, k = k))
+ })
dim(res) <- dim(object)
dimnames(res) <- dimnames(object)
return(res)

Contact - Imprint