Skip to content
Snippets Groups Projects
Commit 115ebdc2 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Merge branch 'install_r_packages' into 'main'

Install r packages

See merge request hub/rshiny-k8s!10
parents 4ebf258b e5f682fb
No related branches found
No related tags found
1 merge request!10Install r packages
Pipeline #102331 passed
Package_name;Deposit_name shiny
shiny;cran shinythemes
shinythemes;cran
### Name : script_install_r_packages.R #!/usr/bin/env Rscript
### Folder : /home/echapeau/Languages/rshiny/in_docker_image/first_app/scripts_R ### Name : install_r_packages.R
### Date : 20/03/2023 ### Folder : ~/scripts
### Aim : Install all packages from CRAN and BioConductor, requiered in the Shiny app. ### Date : 17/04/2023
### Aim : Install all packages from CRAN, BioConductor or github, requiered in the Shiny app.
#### Load file with the list of packages and the name of the deposit ### Install pak packages first
packages_list <- read.csv(file = "/opt/scripts/packages_to_install.csv", header = TRUE, sep = ";", stringsAsFactors = FALSE ) install.packages(c("pak","pkgcache","pkgdepends"), dependencies= NA)
#### Load file with the list of packages
### CRAN Packages packages_list <- read.csv(file = "/opt/scripts/packages_to_install.csv", header = FALSE, sep = ";", stringsAsFactors = FALSE)
cran_pkgs <- packages_list[which(packages_list$Deposit_name == "cran"),"Package_name"] ### Install packages with dependencies with pak packages
### Bioconductor Packages pak::pkg_install(pkg=packages_list[,1])
bioconductor_pkgs <- packages_list[which(packages_list$Deposit_name == "bioconductor"),"Package_name"] # clean the cache of pak
pak::cache_clean()
### Install Packages
if (length(cran_pkgs) >= 1) {
install.packages(cran_pkgs, dependencies = NA)
}
if (length(bioconductor_pkgs) >= 1) {
requireNamespace("BiocManager")
BiocManager::install(bioconductor_pkgs, ask = FALSE)
}
Package_name;Deposit_name shiny
shiny;cran ggplot2
shinythemes;cran limma
tidyverse/tibble
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment