R percent from start

If I have a zoo based time-series in R, is there a simple one-liner way of turning it into a percentage from the first observation?

e.g.

1,2,3,6 -> 0,100,50,100
 
Hi Craig,
From your example, I think you are asking for relative adjacent returns?

try :
library(quantmod)
x<-c(1,2,3,6)

100*Delt(x)

returns:
Delt.1.arithmetic
[1,] NA
[2,] 100
[3,] 50
[4,] 100
 
Back
Top