Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Nov 17, 2022
2 parents 4aa22dd + 6a677c2 commit 4273d01
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/check-link-rot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: check-link-rot

jobs:
check-link-rot:
uses: easystats/workflows/.github/workflows/check-link-rot.yaml@main
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Suggests:
VGAM
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.2.1
RoxygenNote: 7.2.2
Roxygen: list(markdown = TRUE)
Config/testthat/edition: 3
Config/Needs/website:
Expand Down
4 changes: 4 additions & 0 deletions R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
stats::BIC(insight::get_loglikelihood(x, check_response = TRUE, REML = REML, verbose = FALSE)),
error = function(e) NULL
)
# when `get_loglikelihood()` does not work, `stats::BIC` sometimes still works (e.g., `fixest`)
if (is.null(out)) {
out <- tryCatch(stats::BIC(x), error = function(e) NULL)
}
}

out
Expand Down
4 changes: 4 additions & 0 deletions R/performance_aicc.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ performance_aic.default <- function(x, estimator = "ML", verbose = TRUE, ...) {
stats::AIC(insight::get_loglikelihood(x, check_response = TRUE, REML = REML, verbose = verbose)),
error = function(e) NULL
)
# when `get_loglikelihood()` does not work, `stats::AIC` sometimes still works (e.g., `fixest`)
if (is.null(aic)) {
aic <- tryCatch(stats::AIC(x), error = function(e) NULL)
}
}
aic
}
Expand Down

0 comments on commit 4273d01

Please sign in to comment.