Commit f9fbdf92 authored by Simon Pintarelli's avatar Simon Pintarelli

output file for edoz upload, update documentation

parent 0597289c
......@@ -7,15 +7,31 @@ Required packages in R: ``dplyr, ggplot2, reshape, knitr``. Use ``install.packag
Usage
======
.. code-block:: R
Data is read form a csv file ``data.csv`` with columns ``Nummer, Familienname,
A1,..., An`` in ``ISO-8859-1`` encoding. Colums ``A1, ..., An`` contain the points
for each subtask. Change the parameters in ``USER SETTINGS`` on line 103 in
``statistics.Rnw`` to adapt the grading scale to your needs.
library(knitr)
knit('statistics.Rnw')
Input:
- ``data.csv``
- ``edoz.txt``: must be exported from ``Edoz > Noten/Resultate`` and renamed accordingly
Data is read form a csv file ``data.csv`` with columns ``Nummer, Familienname, A1,..., An`` in
``ISO-8859-1`` encoding. Change the parameters in ``USER SETTINGS`` on line 103 in
``statistics.Rnw`` to adapt the grading scale to your needs.
Output:
- ``edoz-grades.txt`` file for upload to edoz
- LaTeX/PDF file containing the statistics
Execution
-----------
- in R
.. code-block:: R
library(knitr)
knit('statistics.Rnw')
`ess-mode <http://ess.r-project.org/>`_ in emacs supports convenient editing of R and Rnw files (noweb files with R code blocks).
- (optional) You can use emacs/`ess-mode <http://ess.r-project.org/>`_ to run the
``Rnw`` - file. This is more convenient, especially if you would like to make
modifications. Here is how to set it up: http://yihui.name/knitr/demo/editors/
......@@ -150,7 +150,8 @@ ggplot(opoints, aes(x=x,y=y)) + geom_violin() + geom_boxplot(width=.1, fill="bla
<<grading_scale_plot, opts.label="codefig", echo=FALSE, results='asis', cache=FALSE, fig.width=5, fig.height=5>>=
I <- match(seq(1, 6, by=dp), scale$grade)
plot1 <- ggplot(scale_plot, aes(x=s, y=grade, col=col)) + geom_line() + scale_y_continuous(breaks=seq(1,6,by=0.5)) + scale_x_continuous(breaks=seq(0, maxpoints, by=ceiling(maxpoints/10))) + xlab("points") + theme(legend.position="bottom")
plot1 <- ggplot(scale_plot, aes(x=s, y=grade, col=col)) + geom_line() + scale_y_continuous(breaks=seq(1,6,by=0.5)) +
scale_x_continuous(breaks=seq(0, maxpoints, by=ceiling(maxpoints/10))) + xlab("points") + theme(legend.position="bottom")
plot1 + theme(legend.title=element_blank())
print(xtable(data.frame(Grade=scale$grade[I], Points=scale$s[I])), include.rownames=FALSE, floating=FALSE)
@
......@@ -184,5 +185,16 @@ ggplot(total_points, aes(x=s)) + stat_ecdf() + xlim(0, maxpoints) + xlab("Total
@ %def
<<edoz_output, include=FALSE, echo=FALSE, warning=FALSE>>=
edoz <- read.csv('edoz.txt', encoding='ISO-8859-1', sep='\t')
colnames(edoz) <- c("Id", "Last Name", "First Name", "Nummer",
"Administration Office", "Direction", "Rep",
"Grade", "Grade Trend", "dropout", "checksum")
out <- inner_join(edoz, data.frame(Nummer=grades$Nummer, grade=grades$grade))
out$Grade <- out$grade
out <- select(out, -c("grade"))
write.csv(out, file="edoz-grades.txt", quote=FALSE, sep="\t", fileEncoding="ISO-8859-1", na="", row.names=FALSE)
@
\end{document}
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