R/renaming.R

Defines functions renaming_outcomes

# Renaming ----------------------------------------------------------------

renaming_outcomes <- function(x) {
    x %>%
        gsub("MeanArtPressure", "MAP", .) %>%
        gsub("Glucose0", "FG", .) %>%
        gsub("TAG", "Tg", .) %>%
        gsub("Waist", "WC", .)
}

renaming_fats <- function(x) {
    x %>%
        gsub('.*(\\d\\d)(\\d)', '\\1:\\2', .) %>%
        gsub('n(\\d)$', 'n-\\1', .) %>%
        gsub('D(\\d\\d)$', 'D-\\1', .) %>%
        gsub('^pct_', '', .) %>%
        gsub('Total(TG|NE)', 'Total', .) %>%
        gsub('^TAG$', 'Clinical TAG', .)
}
lwjohnst86/ada.2017 documentation built on May 21, 2019, 9:01 a.m.