R utilities for grading