Homework for R programming course