I have a dataframe that looks like this: It only shows MTD: 12 and 11 and for the years it only shows 2014 and 2015.
testing
MONTH YEAR Client Revenue Col1 Col2 Col3 Col4
MTD: 12 2014 A. 3203821 651404245 477505485 73.304018 6.709496
MTD: 11 2014 A. 2052195 484668751 334657718 69.048751 6.132221
MTD: 11 2014 B. 1668958 533246253 305447319 57.280725 5.463978
MTD: 12 2015 C. 1524561 3931961251 237707315 6.045515 6.413607
MTD: 12 2015 D. 1506985 171367458 114716359 66.941740 13.136618
MTD: 12 2014 C. 1380678 436264756 250622785 57.447406 5.508990
testing2<-split(testing, testing$Client)
sapply(testing2, ifelse(testing2$MONTH=="MTD:12", (insert row below that shows % change of every column with previous year), testing2)
Then I want to unsplit and put it back together.