0

I have a dataframe consisting of 40 industry returns (as columns) and one column at the very end which is the risk free rate. I would like to subtract the risk free rate column from all the other columns (to get the excess return). Is there an easy way to do this?

This question is very similar, but I am interested in how to identify the last column, other than that, both problems are identical:

Subtract a column in a dataframe from many columns in R

Niccola Tartaglia
  • 1,537
  • 2
  • 26
  • 40

0 Answers0