data manipulaiton

The second issue has been listed independently
index array, summation - General - RStudio Community