R/util.R

Defines functions ensureSuffix

Documented in ensureSuffix

#' @title Utility functions
#' @description \code{ensureSuffix} makes certain that a character vector ends in 
#' a given suffix
#' @export
#' @param x The character vector
#' @param suffix The suffix
#' @return The input character vector with the desired suffix
#' 
ensureSuffix <- function(x, suffix) {
  if (! endsWith(x, suffix)) {
    paste0(x, suffix)
  } else {
    x
  }
}

Try the DramaAnalysis package in your browser

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

DramaAnalysis documentation built on Jan. 13, 2021, 10:02 p.m.