Skip to content
Prev 170079 / 398506 Next

Question about apply()

Sergey Goriatchev wrote:
The immediate problem is that you are missing a comma in x[, z, drop =
FALSE]. But what was wrong with

cbind(data,data/lag(data,-1)-1, suffixes=c("","r"))

(except that it adds a "." to the orginal names, I see no way of NOT
adding a suffix?)