Learn R Programming

eeptools (version 0.9.1)

retained_calc: Function to calculate whether a student has repeated a grade.

Description

This function calculates whether or not a student has repeated a grade. It returns a data.frame with the student ID and a character vector with Y representing they repeated the grade and N that they had not.

Usage

retained_calc(df, sid = "sid", grade = "grade", grade_val = 9)

Arguments

df
a data.frame containing minimally a student identifier and their grade.
sid
a character that indicates the name of the student id attribute in df. The default value is sid.
grade
a character that indicates the name of the student grade attribute in df. The default value is grade.
grade_val
a numeric vector that contains the value of the grade that is being checked for retention. The default value is 9.

Value

a data.frame

Examples

Run this code
x <- data.frame(sid = c(101, 101, 102, 103, 103, 103, 104),
               grade = c(9, 10, 9, 9, 9, 10, 10))
retained_calc(x)

Run the code above in your browser using DataLab