Last active
February 25, 2025 02:13
-
-
Save samcofer/20227ab47991f5298c5d3cf92aee87c1 to your computer and use it in GitHub Desktop.
Pak based package installation for R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start from the RStudio Workbench base image | |
FROM rstudio/rstudio-workbench:jammy | |
# Set repository options globally for all R sessions | |
RUN echo 'options(repos = c( CRAN = "https://packagemanager.posit.co/cran/__linux__/jammy/latest", CRAN_20240401 = "https://packagemanager.posit.co/cran/__linux__/jammy/2024-04-01", BioCsoft = "https://bioconductor.org/packages/3.13/bioc", BioCann = "https://bioconductor.org/packages/3.13/data/annotation", BioCexp = "https://bioconductor.org/packages/3.13/data/experiment", BioCworkflows = "https://bioconductor.org/packages/3.13/workflows" ))' > /opt/R/4.4.1/lib/R/etc/Rprofile.site | |
# Install pak for efficient dependency resolution | |
RUN /opt/R/4.4.1/bin/Rscript -e 'install.packages("pak", repos = "https://packagemanager.posit.co/cran/__linux__/jammy/latest")' | |
# Install required R packages using pak | |
RUN /opt/R/4.4.1/bin/Rscript -e 'pak::pkg_install(c( \ | |
"shiny", "tidyverse", "dplyr", "shinybusy", \ | |
"shinyWidgets", "shinyjs", "gt", "lubridate", "RColorBrewer", "ggpubr", "ggrepel", \ | |
"DT", "survival", "gridExtra", "plotly", "ggplot2", "ggsurvfit", "survminer", \ | |
"renv", "ssh", "jsTreeR", "R.cache", "styler", \ | |
"languageserver", "RPostgres"), dependencies = TRUE)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment