Learn R Programming

cards (version 0.3.0)

.nesting_rename_ard_columns: Rename ARD Columns

Description

If variable is provided, adds the standard variable column to x. If by/strata are provided, adds the standard group## column(s) to x and renames the provided columns to group##_level in x, where ## is determined by the column's position in c(by, strata).

Usage

.nesting_rename_ard_columns(x, variable = NULL, by = NULL, strata = NULL)

Value

a tibble

Arguments

x

(data.frame)
a data frame

variable

(character)
name of variable column in x. Default is NULL.

by

(character)
character vector of names of by columns in x. Default is NULL.

strata

(character)
character vector of names of strata columns in x. Default is NULL.

Examples

Run this code
ard <- nest_for_ard(
  data =
    ADAE |>
      dplyr::left_join(ADSL[c("USUBJID", "ARM")], by = "USUBJID") |>
      dplyr::filter(AOCCSFL %in% "Y"),
  by = "ARM",
  strata = "AESOC",
  rename_columns = FALSE
)

cards:::.nesting_rename_ard_columns(ard, by = "ARM", strata = "AESOC")

Run the code above in your browser using DataLab