Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List options in .stats argument descriptions #1330

Merged
merged 7 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions R/abnormal.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
#' for example, `abnormal = list(Low = c("LOW", "LOW LOW"), High = c("HIGH", "HIGH HIGH"))`.
#' @param exclude_base_abn (`flag`)\cr whether to exclude subjects with baseline abnormality
#' from numerator and denominator.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("abnormal")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("abnormal"))``
#'
#' @note
#' * `count_abnormal()` only considers a single variable that contains multiple abnormal levels.
Expand Down
5 changes: 3 additions & 2 deletions R/abnormal_by_baseline.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
#'
#' @inheritParams argument_convention
#' @param abnormal (`character`)\cr values identifying the abnormal range level(s) in `.var`.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("abnormal_by_baseline")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("abnormal_by_baseline"))``
#'
#' @note
#' * `df` should be filtered to include only post-baseline records.
Expand Down
5 changes: 3 additions & 2 deletions R/abnormal_by_marked.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
#' @inheritParams argument_convention
#' @param category (`list`)\cr a list with different marked category names for single
#' and last or replicated.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("abnormal_by_marked")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("abnormal_by_marked"))``
#'
#' @note `Single, not last` and `Last or replicated` levels are mutually exclusive. If a patient has
#' abnormalities that meet both the `Single, not last` and `Last or replicated` criteria, then the
Expand Down
5 changes: 3 additions & 2 deletions R/abnormal_by_worst_grade.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
#' splits, one on variable `param` and one on variable `grade_dir`.
#'
#' @inheritParams argument_convention
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("abnormal_by_worst_grade")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("abnormal_by_worst_grade"))``
#'
#' @seealso [h_adlb_abnormal_by_worst_grade()] which pre-processes ADLB data frames to be used in
#' [count_abnormal_by_worst_grade()].
Expand Down
5 changes: 3 additions & 2 deletions R/abnormal_by_worst_grade_worsen.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
#' * `id` (`string`)\cr subject variable name.
#' * `baseline_var` (`string`)\cr name of the data column containing baseline toxicity variable.
#' * `direction_var` (`string`)\cr see `direction_var` for more details.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("abnormal_by_worst_grade_worsen")`
#' to see all available statistics.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("abnormal_by_worst_grade_worsen"))``
#'
#' @seealso Relevant helper functions [h_adlb_worsen()] and [h_worsen_counter()] which are used within
#' [s_count_abnormal_lab_worsen_by_baseline()] to process input data.
Expand Down
8 changes: 5 additions & 3 deletions R/analyze_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ control_analyze_vars <- function(conf_level = 0.95,
#' columns) will be considered (`.df_row[[.var]]`, see [`rtables::additional_fun_params`]) and not the whole dataset.
#'
#' @inheritParams argument_convention
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("analyze_vars_numeric")` to see
#' statistics available for numeric variables, and `get_stats("analyze_vars_counts")` for statistics available
#' for non-numeric variables.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options for numeric variables are: ``r shQuote(get_stats("analyze_vars_numeric"))``
#'
#' Options for non-numeric variables are: ``r shQuote(get_stats("analyze_vars_counts"))``
#'
#' @name analyze_variables
#' @order 1
Expand Down
8 changes: 5 additions & 3 deletions R/compare_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
#' statistic.
#'
#' @inheritParams argument_convention
#' @param .stats (`character`)\cr statistics to select for the table. Run
#' `get_stats("analyze_vars_numeric", add_pval = TRUE)` to see statistics available for numeric variables, and
#' `get_stats("analyze_vars_counts", add_pval = TRUE)` for statistics available for non-numeric variables.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options for numeric variables are: ``r shQuote(get_stats("analyze_vars_numeric", add_pval = TRUE))``
#'
#' Options for non-numeric variables are: ``r shQuote(get_stats("analyze_vars_counts", add_pval = TRUE))``
#'
#' @note
#' * For factor variables, `denom` for factor proportions can only be `n` since the purpose is to compare proportions
Expand Down
5 changes: 3 additions & 2 deletions R/count_cumulative.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
#' @inheritParams h_count_cumulative
#' @inheritParams argument_convention
#' @param thresholds (`numeric`)\cr vector of cutoff values for the counts.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("count_cumulative")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("count_cumulative"))``
#'
#' @seealso Relevant helper function [h_count_cumulative()], and descriptive function [d_count_cumulative()].
#'
Expand Down
5 changes: 3 additions & 2 deletions R/count_missed_doses.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
#' @inheritParams s_count_cumulative
#' @inheritParams argument_convention
#' @param thresholds (`numeric`)\cr minimum number of missed doses the patients had.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("count_missed_doses")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("count_missed_doses"))``
#'
#' @seealso
#' * Relevant description function [d_count_missed_doses()] which generates labels for [count_missed_doses()].
Expand Down
5 changes: 3 additions & 2 deletions R/count_occurrences.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
#' @inheritParams argument_convention
#' @param drop (`flag`)\cr whether non-appearing occurrence levels should be dropped from the resulting table.
#' Note that in that case the remaining occurrence levels in the table are sorted alphabetically.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("count_occurrences")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("count_occurrences"))``
#'
#' @note By default, occurrences which don't appear in a given row split are dropped from the table and
#' the occurrences in the table are sorted alphabetically per row split. Therefore, the corresponding layout
Expand Down
5 changes: 3 additions & 2 deletions R/count_occurrences_by_grade.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
#' @param only_grade_groups (`flag`)\cr whether only the specified grade groups should be
#' included, with individual grade rows removed (`TRUE`), or all grades and grade groups
#' should be displayed (`FALSE`).
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("count_occurrences_by_grade")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("count_occurrences_by_grade"))``
#'
#' @seealso Relevant helper function [h_append_grade_groups()].
#'
Expand Down
7 changes: 4 additions & 3 deletions R/count_patients_events_in_cols.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
#' that corresponding table cells will stay blank.
#' @param custom_label (`string` or `NULL`)\cr if provided and `labelstr` is empty then this will
#' be used as label.
#' @param .stats (`character`)\cr statistics to select for the table. Run
#' `get_stats("summarize_patients_events_in_cols")` to see available statistics for this function, in addition
#' to any added using `filters_list`.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' In addition to any statistics added using `filters_list`, statistic options are:
#' ``r shQuote(get_stats("summarize_patients_events_in_cols"))``
#'
#' @name count_patients_events_in_cols
#' @order 1
Expand Down
5 changes: 3 additions & 2 deletions R/count_patients_with_event.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
#' Multiple column names and flags are accepted in this format
#' `c("column_name1" = "flag1", "column_name2" = "flag2")`.
#' Note that only equality is being accepted as condition.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("count_patients_with_event")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("count_patients_with_event"))``
#'
#' @seealso [count_patients_with_flags]
#'
Expand Down
5 changes: 3 additions & 2 deletions R/count_patients_with_flags.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
#' @param flag_variables (`character`)\cr a vector specifying the names of `logical` variables from analysis dataset
#' used for counting the number of unique identifiers.
#' @param flag_labels (`character`)\cr vector of labels to use for flag variables.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("count_patients_with_flags")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("count_patients_with_flags"))``
#'
#' @seealso [count_patients_with_event]
#'
Expand Down
5 changes: 3 additions & 2 deletions R/count_values.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
#'
#' @inheritParams argument_convention
#' @param values (`character`)\cr specific values that should be counted.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("count_values")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("count_values"))``
#'
#' @note
#' * For `factor` variables, `s_count_values` checks whether `values` are all included in the levels of `x`
Expand Down
5 changes: 3 additions & 2 deletions R/estimate_multinomial_rsp.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
#' `var`, should be a factor variable, the values of which will be used as labels within the output table.
#'
#' @inheritParams argument_convention
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("estimate_multinomial_response")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("estimate_multinomial_response"))``
#'
#' @seealso Relevant description function [d_onco_rsp_label()].
#'
Expand Down
5 changes: 3 additions & 2 deletions R/estimate_proportion.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
#'
#' @inheritParams prop_strat_wilson
#' @inheritParams argument_convention
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("estimate_proportion")`
#' to see available statistics for this function.
#' @param method (`string`)\cr the method used to construct the confidence interval
#' for proportion of successful outcomes; one of `waldcc`, `wald`, `clopper-pearson`,
#' `wilson`, `wilsonc`, `strat_wilson`, `strat_wilsonc`, `agresti-coull` or `jeffreys`.
#' @param long (`flag`)\cr whether a long description is required.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("estimate_proportion"))``
#'
#' @seealso [h_proportions]
#'
Expand Down
5 changes: 3 additions & 2 deletions R/incidence_rate.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
#' @param n_events (`string`)\cr name of integer variable indicating whether an event has been observed (1) or not (0).
#' @param id_var (`string`)\cr name of variable used as patient identifier if `"n_unique"` is included in `.stats`.
#' Defaults to `"USUBJID"`.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("estimate_incidence_rate")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("estimate_incidence_rate"))``
#' @param summarize (`flag`)\cr whether the function should act as an analyze function (`summarize = FALSE`), or a
#' summarize function (`summarize = TRUE`). Defaults to `FALSE`.
#' @param label_fmt (`string`)\cr how labels should be formatted after a row split occurs if `summarize = TRUE`. The
Expand Down
5 changes: 3 additions & 2 deletions R/odds_ratio.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
#'
#' @inheritParams split_cols_by_groups
#' @inheritParams argument_convention
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("estimate_odds_ratio")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("estimate_odds_ratio"))``
#' @param method (`string`)\cr whether to use the correct (`"exact"`) calculation in the conditional likelihood or one
#' of the approximations. See [survival::clogit()] for details.
#'
Expand Down
5 changes: 3 additions & 2 deletions R/prop_diff.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
#' @inheritParams prop_diff_strat_nc
#' @inheritParams argument_convention
#' @param method (`string`)\cr the method used for the confidence interval estimation.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("estimate_proportion_diff")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("estimate_proportion_diff"))``
#'
#' @seealso [d_proportion_diff()]
#'
Expand Down
5 changes: 3 additions & 2 deletions R/prop_diff_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
#' @inheritParams argument_convention
#' @param method (`string`)\cr one of `chisq`, `cmh`, `fisher`, or `schouten`; specifies the test used
#' to calculate the p-value.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("test_proportion_diff")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("test_proportion_diff"))``
#'
#' @seealso [h_prop_diff_test]
#'
Expand Down
5 changes: 3 additions & 2 deletions R/summarize_ancova.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
#' @inheritParams argument_convention
#' @param interaction_y (`string` or `flag`)\cr a selected item inside of the `interaction_item` variable which will be
#' used to select the specific ANCOVA results. if the interaction is not needed, the default option is `FALSE`.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("summarize_ancova")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("summarize_ancova"))``
#'
#' @name summarize_ancova
#' @order 1
Expand Down
5 changes: 3 additions & 2 deletions R/summarize_change.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
#' or the change from baseline values (post-baseline) are then summarized.
#'
#' @inheritParams argument_convention
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("analyze_vars_numeric)`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("analyze_vars_numeric"))``
#'
#' @name summarize_change
#' @order 1
Expand Down
5 changes: 3 additions & 2 deletions R/summarize_coxreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
#' Fits a Cox regression model and estimates hazard ratio to describe the effect size in a survival analysis.
#'
#' @inheritParams argument_convention
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("summarize_coxreg")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("summarize_coxreg"))``
#'
#' @details Cox models are the most commonly used methods to estimate the magnitude of
#' the effect in survival analysis. It assumes proportional hazards: the ratio
Expand Down
5 changes: 3 additions & 2 deletions R/summarize_glm_count.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
#' @param rate_mean_method (`character(1)`)\cr method used to estimate the mean odds ratio. Defaults to `emmeans`.
#' see details for more information.
#' @param scale (`numeric(1)`)\cr linear scaling factor for rate and confidence intervals. Defaults to `1`.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("summarize_glm_count")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("summarize_glm_count"))``
#'
#' @details
#' `summarize_glm_count()` uses `s_glm_count()` to calculate the statistics for the table. This
Expand Down
5 changes: 3 additions & 2 deletions R/summarize_num_patients.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
#' `nonunique` records.
#' @param unique_count_suffix (`flag`)\cr whether the `"(n)"` suffix should be added to `unique_count` labels.
#' Defaults to `TRUE`.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("summarize_num_patients")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("summarize_num_patients"))``
#'
#' @name summarize_num_patients
#' @order 1
Expand Down
5 changes: 3 additions & 2 deletions R/summarize_patients_exposure_in_cols.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
#' @inheritParams argument_convention
#' @param ex_var (`string`)\cr name of the variable in `df` containing exposure values.
#' @param custom_label (`string` or `NULL`)\cr if provided and `labelstr` is empty, this will be used as label.
#' @param .stats (`character`)\cr statistics to select for the table. Run
#' `get_stats("analyze_patients_exposure_in_cols")` to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("analyze_patients_exposure_in_cols"))``
#'
#' @name summarize_patients_exposure_in_cols
#' @order 1
Expand Down
5 changes: 3 additions & 2 deletions R/survival_coxph_pairwise.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
#' * `ties` (`string`)\cr specifying the method for tie handling. Default is `"efron"`,
#' can also be set to `"breslow"` or `"exact"`. See more in [survival::coxph()].
#' * `conf_level` (`proportion`)\cr confidence level of the interval for HR.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("coxph_pairwise")`
#' to see available statistics for this function.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("coxph_pairwise"))``
#'
#' @name survival_coxph_pairwise
#' @order 1
Expand Down
5 changes: 3 additions & 2 deletions R/survival_time.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
#' * `quantiles` (`numeric`)\cr vector of length two to specify the quantiles of survival time.
#' @param ref_fn_censor (`flag`)\cr whether referential footnotes indicating censored observations should be printed
#' when the `range` statistic is included.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("surv_time")`
#' to see available statistics for this function.
#' @param .indent_mods (named `integer`)\cr indent modifiers for the labels. Each element of the vector
#' should be a name-value pair with name corresponding to a statistic specified in `.stats` and value the indentation
#' for that statistic's row label.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("surv_time"))``
#'
#' @examples
#' library(dplyr)
Expand Down
5 changes: 3 additions & 2 deletions R/survival_timepoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
#' control), or `"both"`.
#' @param table_names_suffix (`string`)\cr optional suffix for the `table_names` used for the `rtables` to
#' avoid warnings from duplicate table names.
#' @param .stats (`character`)\cr statistics to select for the table. Run `get_stats("surv_timepoint")`
#' to see available statistics for this function.
#' @param .indent_mods (named `integer`)\cr indent modifiers for the labels. Each element of the vector
#' should be a name-value pair with name corresponding to a statistic specified in `.stats` and value the indentation
#' for that statistic's row label.
#' @param .stats (`character`)\cr statistics to select for the table.
#'
#' Options are: ``r shQuote(get_stats("surv_timepoint"))``
#'
#' @name survival_timepoint
#' @order 1
Expand Down
5 changes: 3 additions & 2 deletions man/abnormal.Rd

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

Loading
Loading