-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts
18 lines (13 loc) · 828 Bytes
/
scripts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#Extract R packages
for fold in $(ls ); do CV=$(grep "Version: " $fold"/DESCRIPTION"| awk -F "Version: " '{print $NF}'); echo "install.packages(\""$fold"\", version=\""$CV"\", repos=myrepo)" >>/cluster/projects/nn9997k/sabryr/new_pmetrics/r-pkg.list;done;
export OUTF="/cluster/projects/nn9997k/sabryr/new_pmetrics/r-pkg-require.list"
echo ".libPaths(\"/cluster/projects/nn9997k/sabryr/new_pmetrics/R\")" > $OUTF
echo "myrepo=\"http://cran.r-project.org\"" >> $OUTF
for fold in $(ls ); \
do CV=$(grep "Version: " $fold"/DESCRIPTION"| awk -F "Version: " '{print $NF}'); \
printf 'if (!suppressWarnings' >>$OUTF; \
echo "(require(\"$fold\"))){install.packages(\""$fold"\", version=\""$CV"\", repos=myrepo)}"\
>>$OUTF; \
done;
#TEst
grep "install.packages" r-pkg.list | awk -F "\"" '{print "library("$2")"}' > Rpackages.test