R/path_ending.R

Defines functions path_ending

Documented in path_ending

# Check that file paths end in "/"
#' @title path_ending
#' @description Checks that the paths end in "/" as required
#' @param path path to check
#' @rdname path_ending
#' @export
#' @importFrom stringi stri_sub

path_ending <- function(path){

  if(stringi::stri_sub(path, -1) != "/"){
    path <- paste0(path, "/")
          }
  if(stringi::stri_sub(path, -1) == "/"){path <- path}

  return(path)

}
rystanley/genepopedit documentation built on June 27, 2023, 11:33 p.m.