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

Add @examplesIf to internal examples where applicable #120

Merged
merged 1 commit into from
Apr 15, 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
2 changes: 0 additions & 2 deletions R/ard_aod_wald_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,10 @@ ard_aod_wald_test <- function(x, ...) {

#' Extract data from wald.test object
#'
#'
#' @param wald_test (`data.frame`)\cr wald test object object from `aod::wald.test()`
#'
#' @return a data frame containing the wald test results.
#' @keywords internal

.extract_wald_results <- function(wald_test) {
df <- wald_test$result$chi2[("df")]
statistic <- wald_test$result$chi2[("chi2")]
Expand Down
2 changes: 1 addition & 1 deletion R/ard_effectsize_cohens_d.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ ard_effectsize_paired_cohens_d <- function(data, by, variables, id, ...) {
#'
#' @return ARD data frame
#' @keywords internal
#' @examples
#' @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = c("effectsize", "parameters"), reference_pkg = "cardx"))
#' cardx:::.format_cohens_d_results(
#' by = "ARM",
#' variable = "AGE",
Expand Down
2 changes: 1 addition & 1 deletion R/ard_effectsize_hedges_g.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ ard_effectsize_paired_hedges_g <- function(data, by, variables, id, ...) {
#'
#' @return ARD data frame
#' @keywords internal
#' @examples
#' @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = c("effectsize", "parameters"), reference_pkg = "cardx"))
#' cardx:::.format_hedges_g_results(
#' by = "ARM",
#' variable = "AGE",
Expand Down
2 changes: 1 addition & 1 deletion R/ard_stats_mcnemar_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ard_stats_mcnemar_test <- function(data, by, variables, ...) {
#'
#' @return ARD data frame
#'
#' @examples
#' @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "broom", reference_pkg = "cardx"))
#' cardx:::.format_mcnemartest_results(
#' by = "ARM",
#' variable = "AGE",
Expand Down
2 changes: 1 addition & 1 deletion R/ard_stats_mood_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ard_stats_mood_test <- function(data, by, variables, ...) {
#'
#' @return ARD data frame
#' @keywords internal
#' @examples
#' @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "broom", reference_pkg = "cardx"))
#' cardx:::.format_moodtest_results(
#' by = "SEX",
#' variable = "AGE",
Expand Down
2 changes: 1 addition & 1 deletion R/ard_stats_t_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ ard_stats_paired_t_test <- function(data, by, variables, id, ...) {
#'
#' @return ARD data frame
#' @keywords internal
#' @examples
#' @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "broom", reference_pkg = "cardx"))
#' cardx:::.format_ttest_results(
#' by = "ARM",
#' variable = "AGE",
Expand Down
2 changes: 1 addition & 1 deletion R/ard_stats_wilcox_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ ard_stats_paired_wilcox_test <- function(data, by, variables, id, ...) {
#'
#' @return ARD data frame
#'
#' @examples
#' @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "broom", reference_pkg = "cardx"))
#' # Pre-processing ADSL to have grouping factor (ARM here) with 2 levels
#' ADSL <- cards::ADSL |>
#' dplyr::filter(ARM %in% c("Placebo", "Xanomeline High Dose")) |>
Expand Down
6 changes: 3 additions & 3 deletions R/ard_survival_survfit.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ ard_survival_survfit <- function(x, times = NULL, probs = NULL, type = NULL) {
#'
#' @return a `tibble`
#'
#' @examples
#' @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = c("survival", "broom"), reference_pkg = "cardx"))
#' survival::survfit(survival::Surv(AVAL, CNSR) ~ TRTA, cards::ADTTE) |>
#' cardx:::.process_survfit_time(times = c(60, 180), type = "risk")
#'
Expand Down Expand Up @@ -221,7 +221,7 @@ ard_survival_survfit <- function(x, times = NULL, probs = NULL, type = NULL) {
#'
#' @return a `tibble`
#'
#' @examples
#' @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "survival", reference_pkg = "cardx"))
#' survival::survfit(survival::Surv(AVAL, CNSR) ~ TRTA, cards::ADTTE) |>
#' cardx:::.process_survfit_probs(probs = c(0.25, 0.75))
#'
Expand Down Expand Up @@ -281,7 +281,7 @@ extract_multi_strata <- function(x, df_stat) {
#'
#' @return an ARD data frame of class 'card'
#'
#' @examples
#' @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = c("survival", "broom"), reference_pkg = "cardx"))
#' cardx:::.format_survfit_results(
#' broom::tidy(survival::survfit(survival::Surv(AVAL, CNSR) ~ TRTA, cards::ADTTE))
#' )
Expand Down
1 change: 1 addition & 0 deletions R/proportion_ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ proportion_ci_strat_wilson <- function(x,
#' @seealso [proportion_ci_strat_wilson()]
#'
#' @keywords internal
#'
#' @examples
#' strata_data <- table(data.frame(
#' "f1" = sample(c(TRUE, FALSE), 100, TRUE),
Expand Down
2 changes: 2 additions & 0 deletions man/dot-format_cohens_d_results.Rd

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

2 changes: 2 additions & 0 deletions man/dot-format_hedges_g_results.Rd

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

3 changes: 2 additions & 1 deletion man/dot-format_mcnemartest_results.Rd

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

2 changes: 2 additions & 0 deletions man/dot-format_moodtest_results.Rd

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

3 changes: 2 additions & 1 deletion man/dot-format_survfit_results.Rd

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

2 changes: 2 additions & 0 deletions man/dot-format_ttest_results.Rd

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

3 changes: 2 additions & 1 deletion man/dot-format_wilcoxtest_results.Rd

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

3 changes: 2 additions & 1 deletion man/dot-process_survfit_probs.Rd

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

3 changes: 2 additions & 1 deletion man/dot-process_survfit_time.Rd

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

Loading