Code assignment for R Programming week2