Skip to content

Commit

Permalink
Merge branch 'main' into workflow-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
walkowif authored Apr 19, 2023
2 parents cf96307 + a4d1191 commit c6222c5
Show file tree
Hide file tree
Showing 35 changed files with 360 additions and 234 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: tern
Title: Create Common TLGs Used in Clinical Trials
Version: 0.8.1.9003
Date: 2023-04-02
Version: 0.8.1.9006
Date: 2023-04-19
Authors@R: c(
person("Joe", "Zhu", , "[email protected]", role = c("aut", "cre")),
person("Daniel", "Sabanés Bové", , "[email protected]", role = "aut"),
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# tern 0.8.1.9003
# tern 0.8.1.9006

### Bug Fixes
* Fixed missing label for `TRTEDTM` in `tern` datasets.
Expand All @@ -7,6 +7,7 @@
* Implemented the `lubridate` package for date variables in `tern` datasets.
* Organization of `.gitignore` and `.Rbuildignore`.
* Removed deprecated `footnotes` functions and all related files.
* Added `section_div` and `na_level` (`na_str`) to `summarize_vars`.

# tern 0.8.0

Expand Down
6 changes: 4 additions & 2 deletions R/argument_convention.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@
#' Only considered if `draw = TRUE` is used.
#' @param prune_zero_rows (`flag`)\cr whether to prune all zero rows.
#' @param rsp (`logical`)\cr whether each subject is a responder or not.
#' @param show_labels label visibility: one of "default", "visible" and "hidden".
#' @param show_labels (`string`)\cr label visibility: one of "default", "visible" and "hidden".
#' @param section_div (`string`)\cr string which should be repeated as a section divider after each group
#' defined by this split instruction, or `NA_character_` (the default) for no section divider.
#' @param table_names (`character`)\cr this can be customized in case that the same `vars` are analyzed multiple times,
#' to avoid warnings from `rtables`.
#' @param tte (`numeric`)\cr contains time-to-event duration values.
#' @param var_labels character for label.
#' @param var_labels (`character`)\cr character for label.
#' @param variables (named `list` of `string`)\cr list of additional analysis variables.
#' @param vars (`character`)\cr variable names for the primary analysis variable to be iterated over.
#' @param var (`string`)\cr single variable name for the primary analysis variable.
Expand Down
21 changes: 21 additions & 0 deletions R/df_explicit_na.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,34 @@
#' stringsAsFactors = FALSE
#' )
#'
#' # Example 1
#' # Encode missing values in all character or factor columns.
#' df_explicit_na(my_data)
#' # Also convert logical columns to factor columns.
#' df_explicit_na(my_data, logical_as_factor = TRUE)
#' # Encode missing values in a subset of columns.
#' df_explicit_na(my_data, omit_columns = c("x", "y"))
#'
#' # Example 2
#' # Here we purposefully convert all `M` values to `NA` in the `SEX` variable.
#' # After running `df_explicit_na` the `NA` values are encoded as `<Missing>` but they are not
#' # included when generating `rtables`.
#' adsl <- tern_ex_adsl
#' adsl$SEX[adsl$SEX == "M"] <- NA
#' adsl <- df_explicit_na(adsl)
#'
#' # If you want the `Na` values to be displayed in the table use the `na_level` argument.
#' adsl <- tern_ex_adsl
#' adsl$SEX[adsl$SEX == "M"] <- NA
#' adsl <- df_explicit_na(adsl, na_level = "Missing Values")
#'
#' # Example 3
#' # Numeric variables that have missing values are not altered. This means that any `NA` value in
#' # a numeric variable will not be included in the summary statistics, nor will they be included
#' # in the denominator value for calculating the percent values.
#' adsl <- tern_ex_adsl
#' adsl$AGE[adsl$AGE < 30] <- NA
#' adsl <- df_explicit_na(adsl)
df_explicit_na <- function(data,
omit_columns = NULL,
char_as_factor = TRUE,
Expand Down
6 changes: 5 additions & 1 deletion R/summarize_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -711,10 +711,12 @@ create_afun_summary <- function(.stats, .formats, .labels, .indent_mods) {
summarize_vars <- function(lyt,
vars,
var_labels = vars,
na_level = NA_character_,
nested = TRUE,
...,
show_labels = "default",
table_names = vars,
section_div = NA_character_,
.stats = c("n", "mean_sd", "median", "range", "count_fraction"),
.formats = NULL,
.labels = NULL,
Expand All @@ -726,10 +728,12 @@ summarize_vars <- function(lyt,
vars = vars,
var_labels = var_labels,
afun = afun,
na_str = na_level,
nested = nested,
extra_args = list(...),
inclNAs = TRUE,
show_labels = show_labels,
table_names = table_names
table_names = table_names,
section_div = section_div
)
}
7 changes: 5 additions & 2 deletions man/argument_convention.Rd

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

4 changes: 2 additions & 2 deletions man/compare_variables.Rd

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

4 changes: 2 additions & 2 deletions man/count_cumulative.Rd

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

4 changes: 2 additions & 2 deletions man/count_missed_doses.Rd

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

4 changes: 2 additions & 2 deletions man/count_occurrences.Rd

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

2 changes: 1 addition & 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.

4 changes: 2 additions & 2 deletions man/count_patients_with_event.Rd

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

21 changes: 21 additions & 0 deletions man/df_explicit_na.Rd

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

2 changes: 1 addition & 1 deletion man/estimate_multinomial_rsp.Rd

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

2 changes: 1 addition & 1 deletion man/estimate_proportions.Rd

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

2 changes: 1 addition & 1 deletion man/incidence_rate.Rd

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

2 changes: 1 addition & 1 deletion man/odds_ratio.Rd

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

4 changes: 2 additions & 2 deletions man/prop_diff.Rd

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

4 changes: 2 additions & 2 deletions man/prop_diff_test.Rd

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

4 changes: 2 additions & 2 deletions man/summarize_ancova.Rd

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

4 changes: 2 additions & 2 deletions man/summarize_glm_count.Rd

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

2 changes: 1 addition & 1 deletion man/summarize_num_patients.Rd

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

9 changes: 7 additions & 2 deletions man/summarize_variables.Rd

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

4 changes: 2 additions & 2 deletions man/survival_coxph_pairwise.Rd

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

2 changes: 1 addition & 1 deletion man/survival_time.Rd

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

4 changes: 2 additions & 2 deletions man/survival_timepoint.Rd

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

Loading

0 comments on commit c6222c5

Please sign in to comment.