R/get_file_suffix.R

Defines functions get_file_suffix

Documented in get_file_suffix

#' Get sufffix of input file.
#'
#' @param file_name A string for file names.
#'
#' @return Return file suffix.
#' @export
#' @examples
#' get_file_suffix("myfile.txt")

get_file_suffix <- function(file_name){
  # Paser file name and get file suffix.
  # txt or csv
  if(grepl('.txt', file_name)){
    return('txt')
  }else{
    return('csv')
  }
}
ecnuzdd/PhosMap documentation built on Dec. 7, 2022, 4:09 a.m.