R/bare-file-name.R

Defines functions bare_file_name

Documented in bare_file_name

#' @title Get Bare File Name
#'
#' @description The function provides bare file name without path and extension.
#'
#' @param x A character vector with a file path(s)
#'
#' @return A character vector corresponding to file name without path and
#'   extension.
#'
#' @export
#'
#' @examples
#' bare_file_name(tempfile(pattern = "some_file", fileext = ".ext"))
#'
bare_file_name <- function(x) {
    basename(path = tools::file_path_sans_ext(x))
}
konradedgar/KEmisc documentation built on April 15, 2021, 1:50 p.m.