Skip to content

Commit

Permalink
in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg committed May 24, 2024
1 parent 3752d8a commit 38ee5c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/ard_proportion_ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ ard_proportion_ci <- function(data, variables, by = dplyr::group_vars(data),
"wilson", "wilsoncc",
"strat_wilson", "strat_wilsoncc",
"agresti-coull", "jeffreys"
)) {
),
value = list(where(is_binary) ~ 1L, where(is.logical) ~ TRUE)) {
set_cli_abort_call()

# check installed packages ---------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions R/proportion_ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,13 @@ proportion_ci_strat_wilson <- function(x,
compact()
}

#' @describeIn proportion_ci Helper to determine if vector is binary (logical or 0/1)
#'
#' @export
is_binary <- function(x) {
is.logical(x) || (is_integerish(x) && is_empty(setdiff(x, c(0, 1, NA))))
}

#' Helper Function for the Estimation of Stratified Quantiles
#'
#' This function wraps the estimation of stratified percentiles when we assume
Expand Down

0 comments on commit 38ee5c1

Please sign in to comment.