Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
shajoezhu committed Jan 15, 2025
1 parent 2908900 commit 4cf2edf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
15 changes: 4 additions & 11 deletions R/count_patients_with_event.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,13 @@ NULL
#' tern_ex_adae,
#' .var = "SUBJID",
#' filters = c("TRTEMFL" = "Y", "AEOUT" = "FATAL"),
#' denom = "N_col",
#' .N_col = 456
#' denom = "N_col"
#' )
#'
#' @export
s_count_patients_with_event <- function(df,
.var,
filters,
.N_col, # nolint
.N_row, # nolint
denom = c("n", "N_col", "N_row")) {
col_names <- names(filters)
filter_values <- filters
Expand All @@ -79,9 +76,7 @@ s_count_patients_with_event <- function(df,
result <- s_count_values(
as.character(unique(df[[.var]])),
id_satisfy_filters,
denom = denom,
.N_col = .N_col,
.N_row = .N_row
denom = denom
)
result
}
Expand All @@ -96,9 +91,7 @@ s_count_patients_with_event <- function(df,
#' a_count_patients_with_event(
#' tern_ex_adae,
#' .var = "SUBJID",
#' filters = c("TRTEMFL" = "Y"),
#' .N_col = 100,
#' .N_row = 100
#' filters = c("TRTEMFL" = "Y")
#' )
#'
#' @export
Expand All @@ -116,7 +109,7 @@ a_count_patients_with_event <- function(df,
.indent_mods = NULL,
na_str = default_na_str()) {
x_stats <- s_count_patients_with_event(
df = df, .var = .var, filters = filters, .N_col = .N_col, .N_row = .N_row, denom = denom
df = df, .var = .var, filters = filters, denom = denom
)

if (is.null(unlist(x_stats))) {
Expand Down
21 changes: 8 additions & 13 deletions man/count_patients_with_event.Rd

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

0 comments on commit 4cf2edf

Please sign in to comment.