2. Defining variables. You are given a bond dataset that contains five variables: rate
, rating
,
default
, company
, and risk_free
. Define two new variables: id
and excess_return
.
The variable id
is defined by concatenating the company
and rating
vectors using the paste()
function.
The variable excess_return
is defined by subtracting risk_free
from rate
.