R/extract_universe_from_filename.R

Defines functions extract_universe_from_filename

Documented in extract_universe_from_filename

#' Extracts universe from filename
#' @export

extract_universe_from_filename = function(outfile) {
  outfile = unlist(strsplit(outfile, "/"))
  universe = c("RS", "ZIP5", "SES", "DOD")
  universe_file = universe[unlist(lapply(universe, function(x)
    length(grep(x, outfile)))) == 1]
  return(universe_file)
}
BrianAronson/docshop documentation built on Jan. 13, 2020, 3:13 a.m.