Description Usage Arguments Value Examples
Calculate students' course grades to rank courses in ascending/descending order by a specified method.
1 2 3 4 5 6 | rank_courses(
courses,
grades,
method = c("mean", "1st-quantile", "median", "3rd-quantile"),
descending = TRUE
)
|
courses |
A dataframe containing component weights for each course |
grades |
A dataframe containing grades for students |
method |
one of "method", "median", "lst-quantile", "3rd-quantile", defining the method for calculating the course rankings. |
descending |
A logical value to decide if the rank should be in descending or ascending order. Default to True |
A dataframe containing the rank for specified courses
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | grades <- data.frame(
course_id = c(511, 511, 511, 511, 522, 522, 522, 522),
student_id = c("tom", "tiff", "mike", "joel", "tom", "tiff", "mike", "joel"),
lab1 = c(100, 87.6, 84.4, 100, 0, 0, 0, 0),
lab2 = c(100, 100, 79.6, 100, 0, 0, 0, 0),
lab3 = c(79.2, 81.2, 75.2, 99.6, 0, 0, 0, 0),
lab4 = c(83.6, 89.2, 98.8, 71.2, 0, 0, 0, 0),
quiz1 = c(75.6, 100, 84.8, 96.8, 0, 0, 0, 0),
quiz2 = c(75.6, 73.2, 100, 79.2, 0, 0, 0, 0),
milestone1 = c(0, 0, 0, 0, 100, 100, 92, 98.4),
milestone2 = c(0, 0, 0, 0, 97.6, 77.2, 75.6, 85.6),
milestone3 = c(0, 0, 0, 0, 80, 76.8, 97.6, 96.8),
milestone4 = c(0, 0, 0, 0, 100, 100, 84.4, 100),
feedback = c(0, 0, 0, 0, 100, 85.6, 98.8, 82.4)
)
courses <- data.frame(
course_id = c(511, 522),
lab1 = c(0.15, 0),
lab2 = c(0.15, 0),
lab3 = c(0.15, 0),
lab4 = c(0.15, 0),
quiz1 = c(0.2, 0),
quiz2 = c(0.2, 0),
milestone1 = c(0, 0.1),
milestone2 = c(0, 0.2),
milestone3 = c(0, 0.2),
milestone4 = c(0, 0.3),
feedback = c(0, 0.2)
)
rank_courses(courses, grades, "mean")
rank_courses(courses, grades, "median", descending=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.