code for the R programming class