R/append_colname_prefix.R

Defines functions append_colname_prefix

Documented in append_colname_prefix

#' ruf
#' @name append_colname_prefix
#' @export
#' @import tidyverse
#' @examples
#' append_colname_prefix(data, group_var, var_prefix)
append_colname_prefix <- function(data, group_var, var_prefix) {
  len_group_var = length(group_var)
  names(data)[(len_group_var + 1):ncol(data)] <- paste0(var_prefix, ".", names(data)[(len_group_var + 1):ncol(data)])
  return(data)
}
nelsonroque/ruf documentation built on March 11, 2021, 2:53 p.m.