diff --git a/R/ipu.R b/R/ipu.R index c833dcd..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( @@ -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( @@ -380,6 +380,8 @@ ipu <- function(primary_seed, primary_targets, result$secondary_comp <- secondary_comp } + result$converged <- converged + return(result) } @@ -908,4 +910,4 @@ process_seed_table <- function(df, primary_id, marginal_columns){ df <- df %>% mlr::createDummyFeatures() return(df) -} \ No newline at end of file +}