R Code for QMSS Courses