R/tidy_up-use_underscore.R

Defines functions use_underscore

Documented in use_underscore

#' Substitute dots in column names with underscores.
#'
#' @param data data frame
#'
#' @return data frame with updated column names
#' @export
#'
#' @examples
#' names(airquality)
#' use_underscore(airquality) %>% names()
use_underscore <- function(data) {
  names(data) <- gsub("\\.", "_", names(data))
  data
}

Try the owmr package in your browser

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

owmr documentation built on Jan. 11, 2020, 5:08 p.m.