Basic yield, pricing, duration and convexity calculations. These functions perform simple present value calculations assuming that all periods between payments are the same length. Unlike bond functions in Excel, for example, settlement and maturity dates are not used. By default, duration is Macaulay duration.
yield: annual yield to maturity. If freq > 1, the yield is freq times the per period yield.
principal: maturity payment of the bond, in addition to the final coupon. Default value is $1,000. If the instrument is an annuity, set principal to zero.
freq: number of payments per year.
price: price of the bond
modified: If true, compute modified duration, otherwise compute Macaulay duration. FALSE by default.