rank_courses: Calculate students' course grades to rank courses in...

Description Usage Arguments Value Examples

View source: R/frgtracker.R

Description

Calculate students' course grades to rank courses in ascending/descending order by a specified method.

Usage

1
2
3
4
5
6
rank_courses(
  courses,
  grades,
  method = c("mean", "1st-quantile", "median", "3rd-quantile"),
  descending = TRUE
)

Arguments

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

Value

A dataframe containing the rank for specified courses

Examples

 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)

UBC-MDS/rgtracker documentation built on March 30, 2021, 12:03 p.m.