calculate_final_grade: Calculate final grades for all students in a course

Description Usage Arguments Value Examples

View source: R/frgtracker.R

Description

For each student, the mark for each component will be multiplied with its associated weight, and summed up altogether.

Usage

1
calculate_final_grade(courses, grades, course_ids)

Arguments

courses

A dataframe containing component weights for each course

grades

A dataframe containing grades for students

course_ids

A vector of strings representing the course IDs for which final grades should be calculated.

Value

A dataframe containing final grades for all students in a course.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
grades <- data.frame(
course_id = c("511"),
student_id = c("tom"),
lab1 = c(100),
lab2 = c(80)
)
courses <- data.frame(
course_id = c("511"),
lab1 = c(0.45),
lab2 = c(0.55)
)
calculate_final_grade(courses, grades, course_ids = c("511"))

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