R/fileOpen.R

Defines functions fileOpen

fileOpen <- function(fname,...) {
  con <- NULL
  if(!file.exists(fname)) {
    stop(sprintf("File %s does not appear to exist.",fname))
  }
  if(length(grep('\\.gz$',fname,perl=TRUE))>0) {
    con <- gzfile(fname,open='rt')
  } else {
    con <- file(fname,'r')
  }
  return(con)
}

Try the GEOquery package in your browser

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

GEOquery documentation built on Nov. 8, 2020, 5:18 p.m.