R/getSQLiteFile.R

Defines functions getSQLiteFile

Documented in getSQLiteFile

getSQLiteFile <-
function(destdir=getwd(),destfile='GEOmetadb.sqlite.gz',type='full') {
  localfile <- file.path(destdir,destfile)
  if(type == 'full') {
      url_geo = "http://starbuck1.s3.amazonaws.com/sradb/GEOmetadb.sqlite.gz"
  } else {
      url_geo = "http://starbuck1.s3.amazonaws.com/sradb/GEOmetadb_demo.sqlite.gz"
  }
  

  download.file(url_geo, destfile=localfile,mode='wb')
  cat('Unzipping...\n')
  gunzip(localfile,overwrite=TRUE)
  unzippedlocalfile <- gsub('[.]gz$','',localfile)
  con <- dbConnect(SQLite(),unzippedlocalfile)
  dat <- dbGetQuery(con,'select * from metaInfo')
  dbDisconnect(con)
  cat("Metadata associate with downloaded file:\n")
  print(dat)
  return(unzippedlocalfile)
}

Try the GEOmetadb package in your browser

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

GEOmetadb documentation built on Nov. 8, 2020, 7:19 p.m.