#### bestbird7788

##### New Member
hi
I need to compute link relative ratio, i.e, (this year - last year )/ last year . see my example:
Code:
> myData<-data.frame(year=c(2000,2001,2002,2003,2004),value=c(99,100,110,220,330))
> myData
year value
1 2000    99
2 2001   100
3 2002   110
4 2003   220
5 2004   330
I need result
Code:
year value    lrr
1 2000    99 0.0000
2 2001   100 0.0101
3 2002   110 0.1000
4 2003   220 1.0000
5 2004   330 0.5000
And I know a for statement can compute this, like:
Code:

#### bestbird7788

##### New Member
perfect!
Let me think about on year-on-year basis and on quarter-on-quarter basis.
If I cant compute it out, I wil start a new thread.