# Styling a character vector
customiseText(c("some_column_name", "another_column"))
# Custom styling for specific values
customiseText(x = c("some_column", "another_column"),
custom = c("Custom Name" = "another_column"))
# Keeping specific values unchanged
customiseText(x = c("some_column", "another_column"), keep = "another_column")
# Styling column names and variables in a data frame
dplyr::tibble(
some_column = c("hi_there", "rename_me", "example", "to_keep"),
another_column = 1:4,
to_keep = "as_is"
) |>
dplyr::mutate(
"some_column" = customiseText(some_column, custom = c("EXAMPLE" = "example"), keep = "to_keep")
) |>
dplyr::rename_with(.fn = ~ customiseText(.x, keep = "to_keep"))
Run the code above in your browser using DataLab