priceVsYieldTable | R Documentation |
priceVsYieldTable
Function which calculates the yield to maturities (YTMs) for a passed contract type and a vector of prices.
priceVsYieldTable(x, prices, isPercentage, from)
x |
a contract type, for which to calculate the YTMs. This can also be a timeSeries or EventSeries object. |
prices |
a numeric vector, indicating the price used for calculating the YTMs. |
isPercentage |
a logical, indicating if the 'price' is passed as percentage or not. (default is TRUE). |
from |
a character indicating the date as for which the YTM is calculated. |
a data.frame, representing the prices of the contract and the yield to maturities (YTM).
b <- bond("2013-12-31", maturity = "5 years", nominal = 50000, coupon = 0.02, couponFreq = "1 years") ytm_tbl <- priceVsYieldTable(b, prices = c(80, 90, 100))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.