R/reverse_name.R

Defines functions reverse_name

Documented in reverse_name

#' reverse_name
#'
#' @param x a named vector
#'
#' @return same vector with the vector names as elements and elements as names
#' @export
#'
#' @examples reverse_name(c(a = 'b', c = 'b'))
reverse_name <- function(x) {
  stats::setNames(names(x), x)
}
cimentadaj/cimentadaj documentation built on Dec. 1, 2019, 5:22 p.m.