Codes for R-course