Skip to content

Commit

Permalink
Fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
edelarua committed Oct 16, 2024
1 parent afb3f6a commit 540c757
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/count_cumulative.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ h_count_cumulative <- function(x,

result <- c(
count = count,
fraction = if (count == 0 && .N_col == 0) c(0, 0) else c(count, count / .N_col)
fraction = if (count == 0 && .N_col == 0) 0 else count / .N_col
)
result
}
Expand Down
3 changes: 2 additions & 1 deletion R/count_occurrences_by_grade.R
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,13 @@ s_count_occurrences_by_grade <- function(df,
#' * `a_count_occurrences_by_grade()` returns the corresponding list with formatted [rtables::CellValue()].
#'
#' @examples
#' # We need to ungroup `count_fraction` first so that the `rtables` formatting
#' # We need to ungroup `count_fraction` first so that the `rtables` formatting
#' # function `format_count_fraction()` can be applied correctly.
#' afun <- make_afun(a_count_occurrences_by_grade, .ungroup_stats = "count_fraction")
#' afun(
#' df,
#' .N_col = 10L,
#' .N_row = 10L,
#' .var = "AETOXGR",
#' id = "USUBJID",
#' grade_groups = list("ANY" = levels(df$AETOXGR))
Expand Down
3 changes: 2 additions & 1 deletion man/count_occurrences_by_grade.Rd

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

0 comments on commit 540c757

Please sign in to comment.