Skip to content

Commit

Permalink
remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 22, 2024
1 parent 0100f16 commit 6ec124f
Showing 1 changed file with 1 addition and 70 deletions.
71 changes: 1 addition & 70 deletions R/get_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -497,82 +497,13 @@ get_df.mediate <- function(x, ...) {

.check_df_type <- function(type) {
# handle mixing of ci_method and type arguments
if (tolower(type) %in% c("profile", "uniroot", "quantile", "likelihood", "eti", "hdi", "bci", "boot", "spi", "analytical")) {
if (tolower(type) %in% c("profile", "uniroot", "quantile", "likelihood", "eti", "hdi", "bci", "boot", "spi", "analytical", "nokr")) {

Check warning on line 500 in R/get_df.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/get_df.R,line=500,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 135 characters.
type <- "residual"
}
type
}


# Helper, check args ------------------------------

.df_method_ok <- function(model, method = NULL, verbose = TRUE, ...) {
if (is.null(method)) {
return(TRUE)
}

method <- tolower(method)

# exceptions 1
if (inherits(model, c("polr", "glm", "svyglm"))) {
if (method %in% c("analytical", "profile", "residual", "wald", "likelihood", "normal")) {
return(TRUE)
} else {
if (verbose) {
format_alert("Type of degrees-of-freedom must be one of \"wald\", \"residual\" or \"profile\". Using \"wald\" now.") # nolint
}
return(FALSE)
}
}

# exceptions 2
if (inherits(model, c("phylolm", "phyloglm"))) {
if (method %in% c("analytical", "residual", "wald", "nokr", "normal", "boot")) {
return(TRUE)
} else {
if (verbose) {
format_alert("Type of degrees-of-freedom must be one of \"wald\", \"normal\" or \"boot\". Using \"wald\" now.") # nolint
}
return(FALSE)
}
}

info <- model_info(model, verbose = FALSE)
if (!is.null(info) && isFALSE(info$is_mixed) && method == "boot") {
if (verbose) {
format_alert("Type `boot` only works for mixed models of class `merMod`. To bootstrap this model, use `bootstrap=TRUE, ci_method=\"bcai\"`.") # nolint
}
return(TRUE)
}

if (is.null(info) || !info$is_mixed) {
if (!(method %in% c("analytical", "betwithin", "nokr", "wald", "ml1", "profile", "boot", "uniroot", "residual", "normal"))) { # nolint
if (verbose) {
format_alert("Type of degrees-of-freedom must be one of \"residual\", \"wald\", \"normal\", \"profile\", \"boot\", \"uniroot\", \"betwithin\" or \"ml1\". Using \"wald\" now.") # nolint
}
return(FALSE)
}
return(TRUE)
}

if (!(method %in% c("analytical", "satterthwaite", "betwithin", "kenward", "kr", "nokr", "wald", "ml1", "profile", "boot", "uniroot", "residual", "normal"))) { # nolint
if (verbose) {
format_alert("Type of degrees-of-freedom must be one of \"residual\", \"wald\", \"normal\", \"profile\", \"boot\", \"uniroot\", \"kenward\", \"satterthwaite\", \"betwithin\" or \"ml1\". Using \"wald\" now.") # nolint
}
return(FALSE)
}

if (!info$is_linear && method %in% c("satterthwaite", "kenward", "kr")) {
if (verbose) {
format_alert(sprintf("`%s`-degrees of freedoms are only available for linear mixed models.", method))
}
return(FALSE)
}

TRUE
}


.get_fixest_multi_columns <- function(model) {
# add response and group columns
s <- summary(model)
Expand Down

0 comments on commit 6ec124f

Please sign in to comment.