R Programming Course Exercise