Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions R/ipu.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -380,6 +380,8 @@ ipu <- function(primary_seed, primary_targets,
result$secondary_comp <- secondary_comp
}

result$converged <- converged

return(result)
}

Expand Down Expand Up @@ -908,4 +910,4 @@ process_seed_table <- function(df, primary_id, marginal_columns){
df <- df %>%
mlr::createDummyFeatures()
return(df)
}
}