Skip to content

Commit

Permalink
Another attempt at gathering dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
JanionNevill committed Jan 27, 2025
1 parent 2654ae2 commit 1cfde29
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 42 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ jobs:
- uses: r-lib/actions/setup-r@v2
with:
r-version: '4.3.2'
# Capture dependencies
- name: Capture dependencies
run: |
# Install packages
source("global.R")
# Install renv
install.packages("renv")
# Create lockfile
renv::snapshot()
shell: Rscript {0}
# Setup and install dependencies using renv
- uses: r-lib/actions/setup-renv@v2
# Deploy using rsconnect
- name: Deploy
run: |
Expand Down
100 changes: 58 additions & 42 deletions global.R
Original file line number Diff line number Diff line change
@@ -1,49 +1,65 @@
###### MetaInsight ######

LoadOrInstall <- function(package_name) {
tryCatch(
{
library(package_name)
},
error = function(exptn) {
if (class(exptn)[1] == "packageNotFoundError") {
install.packages(package_name)
library(package_name)
} else {
stop(exptn)
}
}
)
}

# plyr is recommended to be loaded before dplyr for better performance
library(plyr)
LoadOrInstall(plyr)

library(bnma)
library(BUGSnet)
library(combinat)
library(cookies)
library(cowplot)
library(data.table)
library(data.tree)
library(dplyr)
library(future)
library(jsonlite)
library(knitr)
library(gemtc)
library(ggiraphExtra)
library(ggplot2)
library(ggrepel)
library(glue)
library(lubridate)
library(magick)
library(matrixcalc)
library(MCMCvis)
library(metafor)
library(mvtnorm)
library(netmeta)
library(patchwork)
library(plotly)
library(plotrix)
library(promises)
library(R.utils)
library(R6)
library(rio)
library(shiny)
library(shinyalert)
library(shinyAce)
library(shinyBS)
library(shinycssloaders)
library(shinydashboard)
library(shinyjs)
library(shinyWidgets)
library(stringr)
library(rmarkdown)
library(tidyr)
LoadOrInstall(bnma)
LoadOrInstall(BUGSnet)
LoadOrInstall(combinat)
LoadOrInstall(cookies)
LoadOrInstall(cowplot)
LoadOrInstall(data.table)
LoadOrInstall(data.tree)
LoadOrInstall(dplyr)
LoadOrInstall(future)
LoadOrInstall(jsonlite)
LoadOrInstall(knitr)
LoadOrInstall(gemtc)
LoadOrInstall(ggiraphExtra)
LoadOrInstall(ggplot2)
LoadOrInstall(ggrepel)
LoadOrInstall(glue)
LoadOrInstall(lubridate)
LoadOrInstall(magick)
LoadOrInstall(matrixcalc)
LoadOrInstall(MCMCvis)
LoadOrInstall(metafor)
LoadOrInstall(mvtnorm)
LoadOrInstall(netmeta)
LoadOrInstall(patchwork)
LoadOrInstall(plotly)
LoadOrInstall(plotrix)
LoadOrInstall(promises)
LoadOrInstall(R.utils)
LoadOrInstall(R6)
LoadOrInstall(rio)
LoadOrInstall(shiny)
LoadOrInstall(shinyalert)
LoadOrInstall(shinyAce)
LoadOrInstall(shinyBS)
LoadOrInstall(shinycssloaders)
LoadOrInstall(shinydashboard)
LoadOrInstall(shinyjs)
LoadOrInstall(shinyWidgets)
LoadOrInstall(stringr)
LoadOrInstall(rmarkdown)
LoadOrInstall(tidyr)

R.utils::sourceDirectory(path = "R", modifiedOnly = FALSE)

Expand Down

0 comments on commit 1cfde29

Please sign in to comment.