I have a table df that looks like this (with many more columns and many more rows):
I want to create a new table df2 in which each cell in the red box is replaced by percentage change from the value for the previous date (with the top row obviously displaying NA). For example the bottom right cell in the new table should read -.0188
Is there a function (base or from some package) that can do this? If so, how can I use it?