Calculate year-to-year change and month-to-month change

Calculate year-to-year change and month-to-month change
-
```{r,message=F,error=F,warning=F}
change.yy<-list()
change.mm<-list()
for(ddd in 1:cnt){
tmp<-na.omit(xts.data[[ddd]])
change.yy[[ddd]]<-round(diff(tmp,lag=12)/lag(tmp,12)*100,2)[-12]
change.mm[[ddd]]<-round(diff(tmp,lag=1)/lag(tmp,1)*100,2)[-1]
print(head(change.yy[[ddd]]),3)
print(tail(change.yy[[ddd]]),3)
print(head(change.mm[[ddd]]),3)
print(tail(change.mm[[ddd]]),3)
}
```