install_elic_R_ext.R 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Rscript r_install.R
  2. #module load releases/2025b
  3. #module load ELIC_R/1-foss-2025b
  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', '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', 'sp' , 'rmapshaper' ,'adehabitatMA', 'plyr' , 'dplyr' , 'tmap', 'reshape', 'ggplot2', 'png', 'MuMIn', 'tmaptools')
  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("nzelect", "0.4.0")
  23. install_archived("rtweet", "1.2.1")
  24. install_archived("ggseas", "0.5.4")
  25. install_archived("SPEI", "1.8.0")
  26. install_archived("rnaturalearth", "1.0.1")
  27. install_archived("ggspatial", "1.0.1")
  28. install_archived("modifiedmk", "1.5.0")
  29. install_archived("rstac", "1.0.0")
  30. install_archived("languageserver", "0.3.15")
  31. install_archived("hoardr", "0.5.4")
  32. install_archived("AsioHeaders", "1.28.2-1")
  33. install_archived("unigd", "0.1.2")
  34. install_archived("owmr", "0.8.2")
  35. install_archived("rgeoboundaries", "1.3")
  36. install_archived("waffle", "1.0.2")
  37. install_archived("httpgd", "2.0.4")
  38. # 2. Install the specific archived versions
  39. #install_archived("rgeos", "0.6-4")
  40. #install_archived("rgdal", "1.6-7")
  41. #install_archived("maptools", "1.1-8")
  42. #install_archived("RandomFieldsUtils", "1.2.5")
  43. #install_archived("RandomFields", "3.3.14")