# Is return required by a bond investor a function of base interest rate and credit worthiness of the issuer?

The price of a non-zero coupon bond (with dicrete discounting) is found using $$B = \frac{C}{r}\Bigg(1-\frac{1}{(1+r)^n}\Bigg) + \frac{P}{(1+r)^{n}}$$ or for a continuously dicounted version: $$B = C\cdot e^{-r}\Bigg(\frac{1-e^{-r \cdot n}}{1-e^{-r}}\Bigg) + P\cdot e^{-r \cdot n}$$ where $C$ -- coupon payment, $P$ -- face value, $n$ -- number of compounding periods.

Now $r$ depending on the context is called yield to maturity, the return required by investor or base interest rate.

It seems that often an implicit suggestion is made that: $$return \; required \; by \; investor \; = base \; interest \; rate$$

My question is as follows: is above equality true or is yield (or return required by investor) more like $$r (i, c)$$ a function of base interest rate $i$ and credit worthiness $c$?