Skip to content

Instantly share code, notes, and snippets.

@xoolive
Last active January 30, 2016 15:09
Show Gist options
  • Save xoolive/bcf4a0941d647963a638 to your computer and use it in GitHub Desktop.
Save xoolive/bcf4a0941d647963a638 to your computer and use it in GitHub Desktop.
Distribution of grades in a student group
grades <- read.csv("grades.csv")
# I like to have first name, last name, grade
# Adapt the column number to your needs
x <- as.numeric(as.character(grades[,3]))
# Export to png?
# png("grades.png")
# Adapt the breaks to your grades
hist(x, col="lightgreen", freq=FALSE, breaks=seq(10,20,by=.5), family="Ubuntu") # I trashed Arial
# Play with the adjust (default: 1) parameter in density
lines(density(x[!is.na(x)]), col = "red", lwd = 2)
# Close png file
# dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment