data(StockIndex)
yc <- diff(log(StockIndex[, "SP500"])) * 100
yd <- returnseries(StockIndex[, "SP500"], method = "discrete",
percentage = TRUE, trim = TRUE)
yconv <- returnconvert(yd, convdir = "disc2cont",
percentage = TRUE)
all.equal(yc, yconv)
Run the code above in your browser using DataLab