dot-paired_data_pivot_wider: Convert long paired data to wide

.paired_data_pivot_widerR Documentation

Convert long paired data to wide

Description

Convert long paired data to wide

Usage

.paired_data_pivot_wider(data, by, variable, id)

Arguments

data

(data.frame)
a data frame that is one line per subject per group

by

(string)
by column name

variable

(string)
variable column name

id

(string)
subject id column name

Value

a wide data frame

Examples

cards::ADSL[c("ARM", "AGE")] |>
  dplyr::filter(ARM %in% c("Placebo", "Xanomeline High Dose")) |>
  dplyr::mutate(.by = ARM, USUBJID = dplyr::row_number()) |>
  dplyr::arrange(USUBJID, ARM) |>
  cardx:::.paired_data_pivot_wider(by = "ARM", variable = "AGE", id = "USUBJID")

cardx documentation built on Sept. 11, 2024, 9:12 p.m.