Description Usage Arguments Value Examples
Calculate the average grade for a specified number of students and ranks them for a specific course or for the whole program completed thus far.
1 | rank_students(df, courseid = "all", n = 4, ascending = FALSE)
|
df |
A dataframe containing the final grades for each student per course. |
courseid |
A string representing the course ID for which the ranking should be calculated for. Defaults to "all" for all courses completed thus far. |
n |
An integer value that represents the number of students for which the ranking is required for. Defaults to 3. |
ascending |
A logical value indicating whether the top or bottom ranking of students is required. Defaults to FALSE. |
A dataframe containing the rank of the students for the course or for all the program completed thus far.
1 2 3 4 5 6 7 8 | df <- data.frame(
course_id = c(rep("511", 4)),
student_id = c("tom", "tiff", "mike", "joel"),
grade = c(90, 80, 70, 67)
)
rank_students(df = df)
rank_students(df = df, courseid = "511", n = 3, ascending = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.