Clean character vector by replacing all symbols and sequences of symbols with single underscores, ensuring no name begins or ends with a symbol
Examples
x <- c("Patient ID", "_Date-of-Birth", "SBP (mmHg)")
x
#> [1] "Patient ID" "_Date-of-Birth" "SBP (mmHg)"
clean_names(x)
#> [1] "Patient_ID" "Date_of_Birth" "SBP_mmHg"