download_functions_v3.R 585 Bytes
DownloadGEO    <- function( geoid, ddir ){
  # Work directory
  wdir <- file.path( ddir, geoid, fsep = "/" )
  # Create individual folder
  if ( !dir.exists( wdir ) ) {
    dir.create( wdir )
  }
  print("Saving...")
  print(ddir)  
  # Removing downloaded files for geo ID
  file.remove( list.files( wdir, pattern = geoid, full.names = TRUE ) )  
  # Download GSE without neither expression values nor platform info
  GEO  <- getGEO( 
    GEO       = geoid,
    destdir   = wdir,
    AnnotGPL  = FALSE,
    getGPL    = FALSE,
    GSEMatrix = FALSE)  
  return("successful download")
}