r_install_elic.R 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Rscript r_install.R
  2. #module load releases/2022b
  3. #module load ELIC_R/1-foss-2022b
  4. EBROOTELIC_R <- Sys.getenv("EBROOTELIC_R")
  5. # Function to install from CRAN Archive
  6. install_archived <- function(pkg, version) {
  7. url <- paste0("https://cran.r-project.org/src/contrib/Archive/", pkg, "/", pkg, "_", version, ".tar.gz")
  8. install.packages(url, repos = NULL, type = "source", lib=EBROOTELIC_R)
  9. }
  10. packages = c('leaflet', 'satellite', 'intervals', 'spacetime', 'gstat', 'automap', 'reporttools', 'rgeos', 'rworldmap', 'colorRamps', 'mapdata', 'mapproj', 'RPostgreSQL', 'getPass', 'stringdist', 'here', 'svMisc', 'networkD3', 'wordcloud', 'ngram', 'xgboost', 'rts', 'RgoogleMaps', 'packrat', 'rsconnect', 'rpostgis', 'aws.signature', 'aws.s3', 'geosphere', 'fuzzyjoin', 'refinr', 'x13binary', 'seasonal', 'mitools', 'survey', 'sysfonts', 'showtextdb', 'showtext', 'BiocManager', 'rvcheck', 'scatterpie', 'rlist', 'measurements', 'qpdf', 'fda', 'fda.usc', 'gstat', 'countrycode', 'itcSegment', 'rwunderground', 'corrplot', 'prettymapr', 'prospectr', 'rpart.plot', 'varhandle', 'expint', 'actuar', 'psych', 'plotly', 'spatstat', 'raster', 'treemap', 'ggmap', 'hts', 'thief', 'forecastHybrid', 'colourpicker', 'profvis', 'jsonlite', 'readxl', 'tidyverse', 'data.table', 'lubridate', 'stringi', 'snakecase', 'Matrix', 'RSelenium', 'devtools', 'ggplot2', 'metR', 'raster', 'rgeos' , 'sp' , 'rgdal' , 'rmapshaper' ,'adehabitatMA', 'maptools', 'plyr' , 'dplyr' , 'tmap', 'tmaptools', 'reshape', 'ggplot2', 'png', 'SPEI', 'rnaturalearth', 'ggspatial', 'modifiedmk', 'rstac', 'languageserver')
  11. ## Now load or install&load all
  12. package.check <- lapply(
  13. packages,
  14. FUN = function(x) {
  15. if (!require(x, character.only = TRUE)) {
  16. install.packages(x, repos='https://www.freestatistics.org/cran/', lib=EBROOTELIC_R)
  17. library(x, character.only = TRUE)
  18. }
  19. }
  20. )
  21. # 2. Install the specific archived versions
  22. install_archived("MuMIn", "1.47.5")
  23. install_archived("RandomFieldsUtils", "1.2.5")
  24. install_archived("RandomFields", "3.3.14")
  25. install_archived("nzelect", "0.4.0")
  26. install_archived("rtweet", "1.2.1")
  27. install_archived("owmr", "0.1.2")
  28. install_archived("ggseas", "0.5.4")
  29. install_archived("rgeoboundaries", "0.0.0.9000")
  30. install_archived("waffle", "1.0.1")
  31. install_archived("httpgd", "1.3.1")