Skip to content

Commit

Permalink
Apply other suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
edelarua committed May 9, 2023
1 parent f3de16f commit ef246f0
Show file tree
Hide file tree
Showing 25 changed files with 51 additions and 64 deletions.
2 changes: 1 addition & 1 deletion R/compare_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#' @include summarize_variables.R
NULL

#' @describeIn compare_variables S3 generic statistics function to produce a comparison summary.
#' @describeIn compare_variables S3 generic function to produce a comparison summary.
#'
#' @return
#' * `s_compare()` returns output of [s_summary()] and comparisons versus the reference group in the form of p-values.
Expand Down
2 changes: 1 addition & 1 deletion R/count_values.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @name count_values_funs
NULL

#' @describeIn count_values_funs S3 generic statistics function to count values.
#' @describeIn count_values_funs S3 generic function to count values.
#' @inheritParams argument_convention
#' @inheritParams s_summary.logical
#' @param values (`character`)\cr specific values that should be counted.
Expand Down
4 changes: 2 additions & 2 deletions R/cox_regression.R
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ tidy.coxreg.univar <- function(x, # nolint
result
}

#' @describeIn tidy_coxreg Custom tidy method for a multi-variable Cox regression.
#' @describeIn tidy_coxreg Custom tidy method for a multivariate Cox regression.
#'
#' Tidy up the result of a Cox regression model fitted by [`fit_coxreg_multivar()`].
#'
Expand Down Expand Up @@ -395,7 +395,7 @@ fit_coxreg_univar <- function(variables,
)
}

#' @describeIn fit_coxreg Fit a multi-variable Cox regression model.
#' @describeIn fit_coxreg Fit a multivariate Cox regression model.
#'
#' @return
#' * `fit_coxreg_multivar()` returns a `coxreg.multivar` class object which is a named list
Expand Down
2 changes: 1 addition & 1 deletion R/coxph.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' The special term `pairwise` indicate that the model should be fitted individually for
#' every tested level in comparison to the reference level.
#'
#' @param x the variable for which pairwise result is expected
#' @param x the variable for which pairwise result is expected.
#'
#' @return Variable "paired".
#'
Expand Down
10 changes: 5 additions & 5 deletions R/h_cox_regression.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ h_coxreg_univar_formulas <- function(variables,
stats::setNames(forms, nams)
}

#' @describeIn h_cox_regression Helper for multi-variable Cox regression formula. Creates a formulas
#' string. It is used internally by [fit_coxreg_multivar()] for the comparison of multi-variable Cox
#' regression models. Interactions will not be included in multi-variable Cox regression model.
#' @describeIn h_cox_regression Helper for multivariate Cox regression formula. Creates a formulas
#' string. It is used internally by [fit_coxreg_multivar()] for the comparison of multivariate Cox
#' regression models. Interactions will not be included in multivariate Cox regression model.
#'
#' @inheritParams argument_convention
#'
Expand Down Expand Up @@ -234,8 +234,8 @@ h_coxreg_univar_extract <- function(effect,
)
}

#' @describeIn h_cox_regression Tabulation of multi-variable Cox regressions. Utility function to help
#' tabulate the result of a multi-variable Cox regression model for a treatment/covariate variable.
#' @describeIn h_cox_regression Tabulation of multivariate Cox regressions. Utility function to help
#' tabulate the result of a multivariate Cox regression model for a treatment/covariate variable.
#'
#' @inheritParams argument_convention
#' @inheritParams h_coxreg_univar_extract
Expand Down
2 changes: 1 addition & 1 deletion R/h_logistic_regression.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Helper Functions for Multi-Variable Logistic Regression
#' Helper Functions for Multivariate Logistic Regression
#'
#' @description `r lifecycle::badge("stable")`
#'
Expand Down
6 changes: 3 additions & 3 deletions R/logistic_regression.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Multi-Variable Logistic Regression Table
#' Multivariate Logistic Regression Table
#'
#' @description `r lifecycle::badge("stable")`
#'
Expand Down Expand Up @@ -286,11 +286,11 @@ tidy.glm <- function(fit_glm, # nolint
df
}

#' Logistic Regression Multi-Variable Column Layout Function
#' Logistic Regression Multivariate Column Layout Function
#'
#' @description `r lifecycle::badge("stable")`
#'
#' Layout-creating function which creates a multi-variable column layout summarizing logistic
#' Layout-creating function which creates a multivariate column layout summarizing logistic
#' regression results. This function is a wrapper for [rtables::split_cols_by_multivar()].
#'
#' @inheritParams argument_convention
Expand Down
5 changes: 2 additions & 3 deletions R/summarize_colvars.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
#'
#' @description `r lifecycle::badge("stable")`
#'
#' This Analyze Function uses the new S3 generic function [s_summary()] to summarize
#' different variables that are arranged in columns.
#' Additional standard formatting arguments are available.
#' This analyze function uses the S3 generic function [s_summary()] to summarize different variables
#' that are arranged in columns. Additional standard formatting arguments are available.
#'
#' @inheritParams argument_convention
#' @param ... arguments passed to `s_summary()`.
Expand Down
12 changes: 6 additions & 6 deletions R/summarize_coxreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ NULL
#' * `pval_inter`: p-value of the interaction effect between the treatment and the covariate (univariable only)
#' @param .which_vars (`character`)\cr which rows should statistics be returned for from the given model.
#' Defaults to "all". Other options include "var_main" for main effects, "inter" for interaction effects,
#' and "multi_lvl" for multivariable model covariate level rows. When `.which_vars` is "all" specific
#' and "multi_lvl" for multivariate model covariate level rows. When `.which_vars` is "all" specific
#' variables can be selected by specifying `.var_nms`.
#' @param .var_nms (`character`)\cr the `term` value of rows in `df` for which `.stats` should be returned. Typically
#' this is the name of a variable. If using variable labels, `var` should be a vector of both the desired
Expand Down Expand Up @@ -97,7 +97,7 @@ NULL
#' df1_covs <- broom::tidy(univar_covs_model)
#' s_coxreg(model_df = df1_covs, .stats = "hr", .var_nms = c("COVAR2", "Sex (F/M)"))
#'
#' # Multivariable.
#' # Multivariate.
#' m1_variables <- list(
#' time = "TIME", event = "STATUS", arm = "ARM", covariates = c("COVAR1", "COVAR2")
#' )
Expand All @@ -109,7 +109,7 @@ NULL
#' .var_nms = c("COVAR1", "A Covariate Label")
#' )
#'
#' # Multivariable without treatment arm - only "COVAR1" main effect
#' # Multivariate without treatment arm - only "COVAR1" main effect
#' m2_variables <- list(time = "TIME", event = "STATUS", covariates = c("COVAR1", "COVAR2"))
#' multivar_covs_model <- fit_coxreg_multivar(variables = m2_variables, data = dta_bladder)
#' df2_covs <- broom::tidy(multivar_covs_model)
Expand Down Expand Up @@ -256,7 +256,7 @@ a_coxreg <- function(df,
#' layout. This function is a wrapper for several `rtables` layouting functions.
#'
#' @inheritParams fit_coxreg_univar
#' @param multivar (`flag`)\cr Defaults to `FALSE`. If `TRUE` multivariable Cox regression will run, otherwise
#' @param multivar (`flag`)\cr Defaults to `FALSE`. If `TRUE` multivariate Cox regression will run, otherwise
#' univariable Cox regression will run.
#' @param common_var (`character`)\cr the name of a factor variable in the dataset which takes the same value
#' for all rows. This should be created during pre-processing if no such variable currently exists.
Expand All @@ -271,7 +271,7 @@ a_coxreg <- function(df,
#'
#' @export
#' @seealso [fit_coxreg_univar()] and [fit_coxreg_multivar()] which also take the `variables`, `data`,
#' `at` (univariable only), and `control` arguments but return unformatted univariable and multivariable
#' `at` (univariable only), and `control` arguments but return unformatted univariable and multivariate
#' Cox regression models, respectively.
#'
#' @examples
Expand Down Expand Up @@ -323,7 +323,7 @@ summarize_coxreg <- function(lyt,
.section_div = NA_character_) {
if (multivar && control$interaction) {
warning(paste(
"Interactions are not available for multivariable cox regression using summarize_coxreg.",
"Interactions are not available for multivariate cox regression using summarize_coxreg.",
"The model will be calculated without interaction effects."
))
}
Expand Down
7 changes: 3 additions & 4 deletions R/summarize_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,15 @@ summary_labels <- function() {
#'
#' @description `r lifecycle::badge("stable")`
#'
#' We use the new S3 generic function [s_summary()] to implement summaries for
#' different `x` objects. This is used as Statistics Function in combination
#' with the new Analyze Function [summarize_vars()].
#' We use the S3 generic function [s_summary()] to implement summaries for different `x` objects. This
#' is used as a statistics function in combination with the analyze function [summarize_vars()].
#'
#' @inheritParams argument_convention
#'
#' @name summarize_variables
NULL

#' @describeIn summarize_variables S3 generic statistics function to produces a variable summary.
#' @describeIn summarize_variables S3 generic function to produces a variable summary.
#'
#' @return
#' * `s_summary()` returns different statistics depending on the class of `x`.
Expand Down
9 changes: 0 additions & 9 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ Satterthwaite
Schouten
TLG
TLGs
Wojciak
Wojciech
Yuyao
agresti
arcsine
bimj
Expand All @@ -60,7 +57,6 @@ lik
lineplot
lvl
midp
multivariable
nd
onlinelibrary
paramcd
Expand All @@ -74,19 +70,14 @@ rds
repo
responder
responders
roche
songy
subtable
subtables
surv
timepoint
unformatted
univariable
unstratified
waddella
wald
wiley
wilson
wilsoncc
wojciak
wojciech
2 changes: 1 addition & 1 deletion man/compare_variables.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_values_funs.Rd

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

10 changes: 5 additions & 5 deletions man/cox_regression.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/fit_coxreg.Rd

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

10 changes: 5 additions & 5 deletions man/h_cox_regression.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/h_logistic_regression.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/logistic_regression_cols.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/pairwise.Rd

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

5 changes: 2 additions & 3 deletions man/summarize_colvars.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_logistic.Rd

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

7 changes: 3 additions & 4 deletions man/summarize_variables.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/tidy_coxreg.Rd

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

Loading

0 comments on commit ef246f0

Please sign in to comment.