R/clean_heading_text.R

Defines functions clean_heading_text

Documented in clean_heading_text

#' Clean heading text function
#' This internal function is used in subcontents_links and heading_text to create an automated link between the two
#' @param text string
#' @return a string
#' @keywords internal
clean_heading_text <- function(text){

  text %>%
    stringr::str_replace_all(" ", "_") %>%
    stringr::str_to_lower() %>%
    stringr::str_remove_all( "[^_[a-z]]")

}

Try the shinyGovstyle package in your browser

Any scripts or data that you put into this service are public.

shinyGovstyle documentation built on Sept. 12, 2024, 5:07 p.m.