R/correct_filename.R

Defines functions correct_filename

correct_filename <- function(file) {
  ext <- unlist(strsplit(file, split = "\\."))
  ext <- ext[length(ext)]

  file_correct <- ifelse(ext %in% c("nc"),
                         file,
                         paste0(file, ".nc"))

  return(file_correct)
}

Try the cmsafops package in your browser

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

cmsafops documentation built on Sept. 18, 2023, 5:16 p.m.