From c7054e186cd4707b61e01e8775c69168df266a1a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 24 Sep 2024 02:27:35 +0000 Subject: [PATCH] Apply automatic stylistic changes --- R/forestglm.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/R/forestglm.R b/R/forestglm.R index 49bd237..83a4c53 100644 --- a/R/forestglm.R +++ b/R/forestglm.R @@ -91,9 +91,9 @@ TableSubgroupGLM <- function(formula, var_subgroup = NULL, var_cov = NULL, data, model <- stats::glm(formula, data = data, x = T, family = family) # if (!is.null(model$xlevels) & length(model$xlevels[[1]]) != 2) stop("Categorical independent variable must have 2 levels.") } - + xlev <- NA - if (length(model$xlevels[[xlabel]]) > 0){ + if (length(model$xlevels[[xlabel]]) > 0) { xlev <- model$xlevels[[xlabel]] } @@ -168,10 +168,10 @@ TableSubgroupGLM <- function(formula, var_subgroup = NULL, var_cov = NULL, data, names() -> label_val label_val %>% purrr::map(~ possible_svyglm(formula, design = subset(data, get(var_subgroup) == .), x = TRUE, family = family.svyglm)) -> model xlev <- NA - if (length(survey::svyglm(formula, design = data)$xlevels[[xlabel]]) > 0){ + if (length(survey::svyglm(formula, design = data)$xlevels[[xlabel]]) > 0) { xlev <- survey::svyglm(formula, design = data)$xlevels[[xlabel]] } - + # pv_int 구하기 pv_int <- tryCatch( { @@ -217,9 +217,9 @@ TableSubgroupGLM <- function(formula, var_subgroup = NULL, var_cov = NULL, data, select(dplyr::all_of(var_subgroup)) %>% table() %>% names() -> label_val - + xlev <- NA - if (length(stats::glm(formula, data = data, family = family)$xlevels[[xlabel]]) > 0){ + if (length(stats::glm(formula, data = data, family = family)$xlevels[[xlabel]]) > 0) { xlev <- stats::glm(formula, data = data, family = family)$xlevels[[xlabel]] } model.int <- possible_glm(as.formula(gsub(xlabel, paste(xlabel, "*", var_subgroup, sep = ""), deparse(formula))), data = data, family = family)