R/getExtension.R

Defines functions getExtension

Documented in getExtension

getExtension <- function(filename){ 
  # Extract file extension
  ex <- unlist(strsplit(basename(filename), split = "[.]"))
  if (length(ex) < 2) stop(paste0("Cannot recognise extension from '", filename, "' as filename, please check"), call. = FALSE)
  return(ex[-1])
}

Try the GGIRread package in your browser

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

GGIRread documentation built on Oct. 25, 2024, 5:06 p.m.