R scripts for course