Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
exam-statistics
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Simon Pintarelli
exam-statistics
Commits
2efb853a
Commit
2efb853a
authored
Feb 08, 2017
by
Simon Pintarelli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add checks
TODO: provide meaningful error messages
parent
4dc4db5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
statistics.Rnw
statistics.Rnw
+6
-4
No files found.
statistics.Rnw
View file @
2efb853a
...
...
@@ -130,10 +130,12 @@ library(reshape)
library(xtable)
@
<<prepare data, echo=FALSE,
message=FALSE, warning=FALS
E>>=
<<prepare data, echo=FALSE,
error=TRU
E>>=
## read data
dset <- read.csv('marks.csv', encoding='ISO-8859-1')
dset <- dset[, !(names(dset) %in% c("Last.Name", "First.Name"))]
stopifnot(length(dset)-1 == length(max_points_per_task))
dset <- melt(dset, id=c("Number"))
dset$value <- as.numeric(dset$value)
total_points <- group_by(dset, Number) %>% summarize(s=sum(value))
...
...
@@ -149,7 +151,7 @@ colnames(scale_plot) <- c("s", "grade", "col")
scale_plot <- rbind(scale_plot, cbind(scale, col=rep("rounded", nrow(linscale))))
@
<<store grades, echo=FALSE, warning=FALSE>>=
<<store grades, echo=FALSE, warning=FALSE
, error=TRUE
>>=
## export (legi, grade) to csv
write.csv(data.frame(Number=grades$legi, Grade=grades$grade, Points=grades$point),
fileEncoding='ISO-8859-1',
...
...
@@ -160,7 +162,7 @@ write.csv(data.frame(Number=grades$legi, Grade=grades$grade, Points=grades$point
\section*{Grades}
\label{sec:grades}
<<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!'>>=
<<grades, echo=FALSE, warning=FALSE,
error=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!'>>=
ggplot(grades, aes(x=grade)) +
geom_histogram(binwidth = 0.25, alpha=0.8) +
scale_x_continuous(breaks=seq(1,6, by=1)) +
...
...
@@ -172,7 +174,7 @@ ggplot(grades, aes(x=grade)) +
@ %def
<<violing, echo=FALSE, fig.height=1, fig.width=3, fig.show='hold'>>=
<<violing, echo=FALSE,
error=TRUE,
fig.height=1, fig.width=3, fig.show='hold'>>=
ogrades <- cbind.data.frame(x=rep("grade", nrow(grades)), y=grades$grade)
opoints <- cbind.data.frame(x=rep("points", nrow(grades)), y=grades$points)
ggplot(ogrades, aes(x=x,y=y)) +
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment