Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
shiny-k8s
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hub
shiny-k8s
Commits
115ebdc2
Commit
115ebdc2
authored
2 years ago
by
Bryan BRANCOTTE
Browse files
Options
Downloads
Plain Diff
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
!10
Install r packages
Pipeline
#102331
passed
2 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
example_proj/my_packages_to_install.csv
+2
-3
2 additions, 3 deletions
example_proj/my_packages_to_install.csv
scripts/install_r_packages.R
+14
-23
14 additions, 23 deletions
scripts/install_r_packages.R
scripts/packages_to_install.csv
+4
-3
4 additions, 3 deletions
scripts/packages_to_install.csv
with
20 additions
and
29 deletions
example_proj/my_packages_to_install.csv
+
2
−
3
View file @
115ebdc2
Package_name;Deposit_name
shiny
shiny;cran
shinythemes
shinythemes;cran
This diff is collapsed.
Click to expand it.
scripts/install_r_packages.R
+
14
−
23
View file @
115ebdc2
### 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
)
}
This diff is collapsed.
Click to expand it.
scripts/packages_to_install.csv
+
4
−
3
View file @
115ebdc2
Package_name;Deposit_name
shiny
shiny;cran
ggplot2
shinythemes;cran
limma
tidyverse/tibble
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment