Skip to content

Commit

Permalink
Update documentation to add note relavent to #160
Browse files Browse the repository at this point in the history
  • Loading branch information
mstackhouse committed Jan 26, 2024
1 parent 4d39052 commit d277c9c
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 30 deletions.
4 changes: 4 additions & 0 deletions R/count_bindings.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#' use \code{set_denoms_by()}, and the grouping of \code{add_total_row()} will
#' be updated accordingly.
#'
#' Note that when using \code{add_total_row()} with \code{set_pop_data()}, you
#' should call \code{add_total_row()} AFTER calling \code{set_pop_data()},
#' otherwise there is potential for unexpected behaivior with treatment groups.
#'
#' @param e A \code{count_layer} object
#' @param fmt An f_str object used to format the total row. If none is provided,
#' display is based on the layer formatting.
Expand Down
36 changes: 21 additions & 15 deletions R/pop_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,33 @@ build_header_n <- function(table) {

#' Combine existing treatment groups for summary
#'
#' Summary tables often present individual treatment groups,
#' but may additionally have a "Treatment vs. Placebo" or "Total" group added
#' to show grouped summary statistics or counts. This set of functions offers
#' an interface to add these groups at a table level and be consumed by
#' subsequent layers.
#' Summary tables often present individual treatment groups, but may
#' additionally have a "Treatment vs. Placebo" or "Total" group added to show
#' grouped summary statistics or counts. This set of functions offers an
#' interface to add these groups at a table level and be consumed by subsequent
#' layers.
#'
#' \code{add_treat_grps} allows you to specify specific groupings. This is done
#' by supplying named arguments, where the name becomes the new treatment group's
#' name, and those treatment groups are made up of the argument's values.
#' by supplying named arguments, where the name becomes the new treatment
#' group's name, and those treatment groups are made up of the argument's
#' values.
#'
#' \code{add_total_group} is a simple wrapper around \code{add_treat_grps}. Instead of
#' producing custom groupings, it produces a "Total" group by the supplied name, which
#' defaults to "Total". This "Total" group is made up of all existing treatment
#' groups within the population dataset.
#' \code{add_total_group} is a simple wrapper around \code{add_treat_grps}.
#' Instead of producing custom groupings, it produces a "Total" group by the
#' supplied name, which defaults to "Total". This "Total" group is made up of
#' all existing treatment groups within the population dataset.
#'
#' The function \code{treat_grps} allows you to see the custom treatment groups available
#' in your \code{tplyr_table} object
#' Note that when using \code{add_treat_grps} or \code{add_total_row()} with
#' \code{set_pop_data()}, you should call \code{add_total_row()} AFTER calling
#' \code{set_pop_data()}, otherwise there is potential for unexpected behaivior
#' with treatment groups.
#'
#' The function \code{treat_grps} allows you to see the custom treatment groups
#' available in your \code{tplyr_table} object
#'
#' @param table A \code{tplyr_table} object
#' @param ... A named vector where names will become the new treatment group names,
#' and values will be used to construct those treatment groups
#' @param ... A named vector where names will become the new treatment group
#' names, and values will be used to construct those treatment groups
#'
#' @return The modified table object
#' @export
Expand Down
4 changes: 4 additions & 0 deletions man/add_total_row.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 21 additions & 15 deletions man/treat_grps.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d277c9c

Please sign in to comment.