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
3a82fa73
Commit
3a82fa73
authored
10 months ago
by
Elodie CHAPEAUBLANC
Browse files
Options
Downloads
Patches
Plain Diff
Modify configuration file for installation of R packages
parent
431abbc1
Branches
docker-images
No related tags found
No related merge requests found
Pipeline
#137635
passed
10 months ago
Stage: build
Stage: test
Pipeline: shiny-k8s-example
#137645
Pipeline: shiny-k8s-example
#137644
Pipeline: shiny-k8s-example
#137637
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/install_r_packages.R
+12
-8
12 additions, 8 deletions
scripts/install_r_packages.R
with
12 additions
and
8 deletions
scripts/install_r_packages.R
+
12
−
8
View file @
3a82fa73
#!/usr/bin/env Rscript
### Name : install_r_packages.R
### Folder : ~/scripts
### Date : 17/04/2023
### Date :
22/08/2024 from previous version
17/04/2023
### Aim : Install all packages from CRAN, BioConductor or github, requiered in the Shiny app.
### Install
pak packages first
### Install
some first pakcages included pak
# Specify your packages
my_packages
<-
c
(
"pak"
,
"pkgcache"
,
"pkgdepends"
,
"pillar"
,
"shinipsum"
)
# Extract not installed packages
...
...
@@ -18,16 +18,20 @@ if(length(not_installed)){
print
(
"packages previously installed in the basic image"
)
}
#### Load file with the list of packages
packages_list
<-
read.csv
(
file
=
"/opt/scripts/packages_to_install.csv"
,
header
=
TRUE
,
sep
=
";"
,
stringsAsFactors
=
FALSE
)
#### Load file with the list of packages for installation of supplementary packages
#### Part used in shiny-example docker images for install packages needed for shiny app
additional_packages
<-
read.csv
(
file
=
"/opt/scripts/packages_to_install.csv"
,
header
=
TRUE
,
sep
=
";"
,
stringsAsFactors
=
FALSE
)
packages_name
<-
additional_packages
$
Package_name
#### Selection of packages not yet installed
packages_needed
<-
packages_name
[
!
(
packages_name
%in%
installed.packages
()[
,
"Package"
])]
print
(
"Installation for other packages needed : "
)
print
(
paste
(
packages_
list
$
Package_name
,
sep
=
""
,
collapse
=
","
))
print
(
paste
(
packages_
needed
,
sep
=
""
,
collapse
=
","
))
### Install packages with dependencies with pak packages
for
(
i
in
1
:
length
(
packages_
list
$
Package_name
))
{
for
(
i
in
1
:
length
(
packages_
needed
))
{
print
(
"Installation of: "
)
print
(
packages_
list
$
Package_name
[
i
])
pak
::
pkg_install
(
pkg
=
packages_
list
$
Package_name
[
i
])
print
(
packages_
needed
[
i
])
pak
::
pkg_install
(
pkg
=
packages_
needed
[
i
])
print
(
"Installation done!!"
)
}
# clean the cache of pak
...
...
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