st_rename: Add column rename information to st object

View source: R/table-object.R

st_renameR Documentation

Add column rename information to st object

Description

See the cols_rename argument passed to stable() and then tab_cols(). This function can be called multiple times and will accumulate cols_rename data.

Usage

st_rename(x, ..., .list = NULL)

Arguments

x

an stobject

...

column rename items in new-name = old-name format; passed to stable() as cols_rename

.list

a named list of rename data with the format old-name = new-name; this specification is similar passing items via ..., but note that rename specification is reversed. The intended use for this argument is to utilize list output from the yspec package which takes the form column-name = short-name (e.g. WT = weight for the WT column).

Examples

library(dplyr)

st_new(stdata()) %>% st_rename(weight = WT) %>% stable()

st_new(stdata()) %>% st_rename(.list = list(WT = "weight")) %>% stable()


metrumresearchgroup/pmtables documentation built on Oct. 27, 2024, 5:16 p.m.