R/getExtension.R

Defines functions getExtension

Documented in getExtension

#' getExtension
#'
#' Get the file extension of a given file.
#' This function takes a file path as input and returns the file extension without the dot.
#'
#' @param file A character string containing the file path.
#'
#' @return A character vector containing the file extension without the dot.
#' @examples
#' getExtension("example.txt")
#'
#' @export

getExtension <- function(file){
  ex <- strsplit(basename(file), split="\\.")[[1]]
  return(ex[-1])
}

Try the colouR package in your browser

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

colouR documentation built on Sept. 26, 2023, 5:11 p.m.