R/getDirsContainingFid.R

Defines functions getDirsContainingFid

Documented in getDirsContainingFid

getDirsContainingFid <- function(path) {
  subdirs <- dir(path, full.names = TRUE)
  if (length(subdirs) > 0) {
    cond <- sapply(subdirs, function(x)  {
      content <- dir(x)
      # subdirs must contain fid, acqu and acqus files
      return("fid" %in% content && "acqu" %in% content && "acqus" %in% content)
    })
    subdirs <- subdirs[cond]
  }
  return(subdirs)
}
ManonMartin/PepsNMR documentation built on Nov. 28, 2021, 6:22 p.m.