From ff1c27243c99d2b75b13de74be502661b49ed127 Mon Sep 17 00:00:00 2001 From: Stephanie Zimmer Date: Fri, 20 Nov 2020 09:55:10 -0500 Subject: [PATCH 1/3] Update ggplot call to remove reference to data twice No need to call `weight_factor` using `primary_seed$weight_factor` within ggplot2. This adds an annoying warning but now will have same behavior but no warning. --- R/ipu.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/ipu.R b/R/ipu.R index c833dcd..0907524 100644 --- a/R/ipu.R +++ b/R/ipu.R @@ -350,7 +350,7 @@ ipu <- function(primary_seed, primary_targets, result$weight_tbl <- primary_seed result$weight_tbl$geo_all <- NULL result$weight_dist <- ggplot2::ggplot( - data = primary_seed, ggplot2::aes(primary_seed$weight_factor) + data = primary_seed, ggplot2::aes(weight_factor) ) + ggplot2::geom_histogram(bins = 10, fill = "darkblue", color = "gray") + ggplot2::labs( @@ -908,4 +908,4 @@ process_seed_table <- function(df, primary_id, marginal_columns){ df <- df %>% mlr::createDummyFeatures() return(df) -} \ No newline at end of file +} From 04fe8cff3dc54d3b2dc46a2c7f53d9fd88d95538 Mon Sep 17 00:00:00 2001 From: Stephanie Zimmer Date: Fri, 20 Nov 2020 09:57:09 -0500 Subject: [PATCH 2/3] Save the convergence status in the object Add the converged status to the output of the ipu function. --- R/ipu.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/ipu.R b/R/ipu.R index 0907524..3ec7a4d 100644 --- a/R/ipu.R +++ b/R/ipu.R @@ -380,6 +380,8 @@ ipu <- function(primary_seed, primary_targets, result$secondary_comp <- secondary_comp } + result$converged <- converged + return(result) } From c764fde93322e8d490869867de4d8bb8b9509cdb Mon Sep 17 00:00:00 2001 From: Stephanie Zimmer Date: Fri, 20 Nov 2020 09:59:38 -0500 Subject: [PATCH 3/3] Add convergence status to description of output of ipu function --- R/ipu.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/ipu.R b/R/ipu.R index 3ec7a4d..7338a13 100644 --- a/R/ipu.R +++ b/R/ipu.R @@ -62,8 +62,8 @@ #' The min_scale caps the minimum weight at a multiple of that average. Defaults #' to \code{0.0001} (basically turned off). #' @return a \code{named list} with the \code{primary_seed} with weight, a -#' histogram of the weight distribution, and two comparison tables to aid in -#' reporting. +#' histogram of the weight distribution, two comparison tables to aid in +#' reporting, and the convergence status. #' @export #' @examples #' hh_seed <- dplyr::tibble(