Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save florisvanvugt/b48390ea1112a1823ae1dff907a68f0a to your computer and use it in GitHub Desktop.
Save florisvanvugt/b48390ea1112a1823ae1dff907a68f0a to your computer and use it in GitHub Desktop.
## Source: https://fep.umontreal.ca/a-propos/enseigner-a-la-fep/pedagogie/evaluation-des-apprentissages/
num2let <- data.frame(
seuil=c(0,.345,.495,.535,.565,.595,.645,.695,.725,.765,.795,.845,.895),
lettre=c('F','E','D','D+','C-','C','C+','B-','B','B+','A-','A','A+'))
findlet <- function(val) {
## Convert numeric grade into letter grade
if (is.na(val)) { return ("NA") }
selseuil <- max(subset(num2let,seuil<=val)$seuil)
return(num2let[ num2let$seuil==selseuil,'lettre'][[1]])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment