| 1 | #!/bin/bash |
| 2 | |
| 3 | mkdir -p ../summariesByStation |
| 4 | |
| 5 | files=`ls ../aggexp/data/*.csv` |
| 6 | for file in $files; do |
| 7 | stationName=`basename -s .csv $file` |
| 8 | sed "s/STATIONNAME/$stationName/g" modele.Rnw > tmp.Rnw |
| 9 | case $stationName in |
| 10 | "ALE"|"MRA"|"NEI"|"MAS") |
| 11 | sed -i "s/EXPERTSINDICES/c(1:4,6:10)/" tmp.Rnw |
| 12 | ;; |
| 13 | *) |
| 14 | sed -i "s/EXPERTSINDICES/1:10/" tmp.Rnw |
| 15 | ;; |
| 16 | esac |
| 17 | R CMD BATCH runSummary.R |
| 18 | pdflatex tmp.tex |
| 19 | mv tmp.pdf ../summariesByStation/$stationName.pdf |
| 20 | done |
| 21 | |
| 22 | rm -f tmp* |
| 23 | rm -f .RData |
| 24 | rm -f runSummary.Rout |
| 25 | if [ -d figs/ ]; then |
| 26 | rm -rf figs/ |
| 27 | fi |