Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
edelarua committed Aug 31, 2023
1 parent 8aa8c98 commit 8a573c1
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion R/analyze_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ s_summary.numeric <- function(x,
# Convert negative values to NA for log calculation.
x_no_negative_vals <- x
x_no_negative_vals[x_no_negative_vals <= 0] <- NA
y$geom_mean <- if (all(x == 0) && length(x) > 0) {
y$geom_mean <- if (all(!is.na(x)) && all(x == 0) && length(x) > 0) {
c("geom_mean" = 0)
} else {
c("geom_mean" = exp(mean(log(x_no_negative_vals), na.rm = FALSE)))
Expand Down
4 changes: 2 additions & 2 deletions R/analyze_vars_in_cols.R
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ analyze_vars_in_cols <- function(lyt,
} else {
res_imp <- imputation_rule(
.df_row, x_stats, stat,
imp = imp_rule, post = as.numeric(tail(.spl_context$value, 1)) > 0
imp_rule = imp_rule, post = as.numeric(tail(.spl_context$value, 1)) > 0
)
res <- res_imp[["val"]]
na_level <- res_imp[["na_level"]]
Expand Down Expand Up @@ -294,7 +294,7 @@ analyze_vars_in_cols <- function(lyt,
} else {
res_imp <- imputation_rule(
.df_row, x_stats, stat,
imp = imp_rule, post = as.numeric(tail(.spl_context$value, 1)) > 0
imp_rule = imp_rule, post = as.numeric(tail(.spl_context$value, 1)) > 0
)
res <- res_imp[["val"]]
na_level <- res_imp[["na_level"]]
Expand Down
2 changes: 0 additions & 2 deletions R/formatting_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,6 @@ format_xx <- function(str) {
#' Format numeric values to print with a specified number of significant figures.
#'
#' @param sigfig (`integer`)\cr number of significant figures to display.
#' @param x (`numeric`)\cr value.
#' @param ... required for `rtables` interface.
#'
#' @return An `rtables` formatting function.
#'
Expand Down
3 changes: 3 additions & 0 deletions R/imputation_rule.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#' @description `r lifecycle::badge("stable")`
#'
#' @inheritParams argument_convention
#' @param x_stats (`named list`)\cr a named list of statistics, typically the results of [s_summary()].
#' @param stat (`character`)\cr statistic to return the value/NA level of according to the imputation
#' rule applied.
#' @param imp_rule (`character`)\cr imputation rule setting. Set to `"1/3"` to implement 1/3 imputation
#' rule or `"1/2"` to implement 1/2 imputation rule.
#' @param post (`flag`)\cr whether the data corresponds to a post-dose time-point (defaults to `FALSE`).
Expand Down
4 changes: 0 additions & 4 deletions man/format_sigfig.Rd

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

5 changes: 5 additions & 0 deletions man/imputation_rule.Rd

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

0 comments on commit 8a573c1

Please sign in to comment.