R/downloadGIS.R

#' Download GIS.
#' Downloads and extracts GIS files
#' @examples
#' downloadGIS()
#' @export

downloadGIS<-function() {
  print("Downloading...")
  download.file(url="https://github.com/p-schaefer/OSGeo4W64/archive/master.zip",
                destfile=gsub("/","\\",(paste0(.libPaths(),"/RandGRASSGIS/OSGeo4W64.zip")),fixed=T))
  print("Extracting...")
  unzip(zipfile=gsub("/","/",(paste0(.libPaths(),"/RandGRASSGIS/OSGeo4W64.zip")),fixed=T),
        exdir=gsub("/","/",(paste0(.libPaths(),"/RandGRASSGIS")),fixed=T))
  file.rename(from=gsub("/","/",(paste0(.libPaths(),"/RandGRASSGIS/OSGeo4W64-master")),fixed=T),
             to=gsub("/","/",(paste0(.libPaths(),"/RandGRASSGIS/OSGeo4W64")),fixed=T))
  print("Done")
}
  
p-schaefer/RandGRASSGIS documentation built on May 24, 2019, 5:56 p.m.