Skip to contents

Relabel a subset of variables in a data set.

Usage

var_relabel(x, ...)

Arguments

x

(data.frame)
Data frame containing variables to which labels are applied.

...

(named character)
Name-Value pairs, where name corresponds to a variable name in x and the value to the new variable label.

Examples

adsl <- radsl()
random.cdisc.data:::var_relabel(adsl,
  STUDYID = "Study Identifier",
  USUBJID = "Unique Subject Identifier"
)
#> # A tibble: 400 × 55
#>    STUDYID USUBJID    SUBJID SITEID   AGE AGEU  SEX   RACE  ETHNIC COUNTRY DTHFL
#>    <chr>   <chr>      <chr>  <chr>  <int> <fct> <fct> <fct> <fct>  <fct>   <fct>
#>  1 AB12345 AB12345-C… id-118 CAN-17    34 YEARS M     ASIAN "NOT … CAN     N    
#>  2 AB12345 AB12345-R… id-384 RUS-1     37 YEARS M     WHITE "NOT … RUS     N    
#>  3 AB12345 AB12345-C… id-38  CHE-11    35 YEARS F     ASIAN "NOT … CHE     N    
#>  4 AB12345 AB12345-J… id-267 JPN-5     38 YEARS M     ASIAN "NOT … JPN     Y    
#>  5 AB12345 AB12345-C… id-139 CHN-2     33 YEARS M     ASIAN "NOT … CHN     N    
#>  6 AB12345 AB12345-C… id-199 CHN-11    31 YEARS M     BLAC… " NOT… CHN     N    
#>  7 AB12345 AB12345-C… id-133 CHN-1     33 YEARS F     ASIAN "NOT … CHN     N    
#>  8 AB12345 AB12345-B… id-175 BRA-1     33 YEARS M     ASIAN "HISP… BRA     Y    
#>  9 AB12345 AB12345-P… id-197 PAK-17    29 YEARS M     ASIAN "NOT … PAK     N    
#> 10 AB12345 AB12345-C… id-201 CHN-11    55 YEARS F     ASIAN "HISP… CHN     N    
#> # ℹ 390 more rows
#> # ℹ 44 more variables: INVID <chr>, INVNAM <chr>, ARM <fct>, ARMCD <fct>,
#> #   ACTARM <fct>, ACTARMCD <fct>, TRT01P <fct>, TRT01A <fct>, TRT02P <fct>,
#> #   TRT02A <fct>, REGION1 <fct>, STRATA1 <fct>, STRATA2 <fct>, BMRKR1 <dbl>,
#> #   BMRKR2 <fct>, ITTFL <fct>, SAFFL <fct>, BMEASIFL <fct>, BEP01FL <fct>,
#> #   AEWITHFL <fct>, RANDDT <date>, TRTSDTM <dttm>, TRTEDTM <dttm>,
#> #   TRT01SDTM <dttm>, TRT01EDTM <dttm>, TRT02SDTM <dttm>, TRT02EDTM <dttm>, …