Commit 2998a744 authored by Simon Pintarelli's avatar Simon Pintarelli

add bash scripts, remove warnings from tex output

parent 6332a49a
/.RData
/edoz-final.txt
/grades-out.csv
/grades-template.txt
/statistics.aux
/statistics.log
/statistics.pdf
/statistics.tex
/tex.log
/r.log
/marks.xls
/marks.csv
#!/usr/bin/bash
if [[ $# -lt 1 ]]; then
echo "Usage: ${0} Grades*txt"
echo ""
echo "probably you want to use the following file?"
echo $(ls Grades*txt 2> /dev/null | head -n1)
exit 1
fi
ln -sf $1 grades-template.txt
./init-spreadsheet-from-edoz.py $1
#!/usr/bin/bash
type R > /dev/null
if [[ ! $? -eq 0 ]]; then
echo "could not find R"
exit 1
fi
echo "marks.xls -> marks.csv"
./xls2csv.py marks.xls marks.csv
R < knit.R --save 2> R.log || exit 1
echo "Generate edoz-final.txt for upload."
python pandas-script.py
echo "Running pdflatex..."
pdflatex statistics.tex > tex.log && pdflatex statistics.tex > /dev/null || echo "Warning: pdflatex failed!"
library(knitr)
knit('statistics.Rnw', quiet=TRUE)
......@@ -13,6 +13,3 @@ out.columns = ['Id', 'Last Name', 'First Name', 'Number', 'Administration Office
'* (dropout/no show)', 'Checksum']
out.to_csv('edoz-final.txt', sep='\t', encoding='ISO-8859-1', index=False)
knapp = out[out['Grade']==3.75]
......@@ -112,10 +112,10 @@ opts_template[["set"]](
tidy.opts = list(width.cutoff = partWidth)))
@
<<libaries, echo=FALSE>>=
<<libaries, echo=FALSE, message=FALSE, warning=FALSE>>=
library(dplyr)
library(ggplot2)
library(reshape)
library(dplyr)
library(xtable)
@
......@@ -148,7 +148,7 @@ write.csv(data.frame(Number=grades$legi, Grade=grades$grade),
\section*{Grades}
\label{sec:grades}
<<grades, echo=FALSE, warning=TRUE, fig.width=5, fig.height=5, out.width="0.49\\linewidth", fig.show='hold', fig.env="figure*", fig.subcap=c("Histogram", "CDF"), fig.pos='h!'>>=
<<grades, echo=FALSE, warning=FALSE, fig.width=5, fig.height=5, out.width="0.49\\linewidth", fig.show='hold', fig.env="figure*", fig.subcap=c("Histogram", "CDF"), fig.pos='h!'>>=
ggplot(grades, aes(x=grade)) +
geom_histogram(binwidth = 0.25, alpha=0.8) +
scale_x_continuous(breaks=seq(1,6, by=1)) +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment