From efcf2f56852973ee83b4dc651f052136b06e8853 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Feb 2026 01:52:23 +0000 Subject: [PATCH 1/2] Initial plan From 5d871505fb7eefa56489edf35cac218682d6caec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Feb 2026 02:01:37 +0000 Subject: [PATCH 2/2] Fix maintainability and style issues in func_discord_regression.R Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com> --- R/func_discord_regression.R | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/R/func_discord_regression.R b/R/func_discord_regression.R index d472922..2fe9d65 100644 --- a/R/func_discord_regression.R +++ b/R/func_discord_regression.R @@ -28,7 +28,7 @@ discord_regression <- function(data, data_processed = FALSE, coding_method = "none", fast = TRUE) { - if (data_processed == TRUE & !is.data.frame(data)) { + if (data_processed == TRUE && !is.data.frame(data)) { stop("data must be a data frame if data_processed is TRUE") } if (data_processed == FALSE) { @@ -36,13 +36,13 @@ discord_regression <- function(data, } # if no demographics provided if (is.null(demographics)) { - if (is.null(sex) & is.null(race)) { + if (is.null(sex) && is.null(race)) { demographics <- "none" - } else if (is.null(sex) & !is.null(race)) { + } else if (is.null(sex) && !is.null(race)) { demographics <- "race" - } else if (!is.null(sex) & is.null(race)) { + } else if (!is.null(sex) && is.null(race)) { demographics <- "sex" - } else if (!is.null(sex) & !is.null(race)) { + } else if (!is.null(sex) && !is.null(race)) { demographics <- "both" } } @@ -116,7 +116,7 @@ discord_regression <- function(data, list(formula_obj = formula_) )) - return(model) + model } # alias @@ -164,13 +164,13 @@ discord_between_model <- function(data, # if no demographics provided if (is.null(demographics)) { - if (is.null(sex) & is.null(race)) { + if (is.null(sex) && is.null(race)) { demographics <- "none" - } else if (is.null(sex) & !is.null(race)) { + } else if (is.null(sex) && !is.null(race)) { demographics <- "race" - } else if (!is.null(sex) & is.null(race)) { + } else if (!is.null(sex) && is.null(race)) { demographics <- "sex" - } else if (!is.null(sex) & !is.null(race)) { + } else if (!is.null(sex) && !is.null(race)) { demographics <- "both" } } @@ -243,5 +243,5 @@ discord_between_model <- function(data, list(formula_obj = formula_) )) - return(model) + model }