R/extractChannel.R

Defines functions extractChannel

extractChannel <- function(file, channel){
  data <- readStructurized(normalizePath(file, mustWork = T))
  
  if(is.numeric(channel)){
    si <- Filter(function(x) x$id == channel, data$streams)[[1]]
  } else {
    si <- Filter(function(x) x$name == channel, data$streams)[[1]]
  }
  
  do.call(
    DBcombine,
    Filter(
      function(b) identical(SI(b), si) ,
      data$blocks
    )
  )
}
tz-lom/Resonance.R3 documentation built on July 18, 2019, 3:44 p.m.