| as.spotrate {fixedincome} | R Documentation |
Coerce to SpotRate
Description
Coerce character objects to SpotRate class
Usage
as.spotrate(x, ...)
## S4 method for signature 'character'
as.spotrate(x, simplify = TRUE)
## S4 method for signature 'SpotRateCurve'
as.spotrate(x, ...)
## S4 method for signature 'ForwardRate'
as.spotrate(x, ...)
Arguments
x |
a character with SpotRate specification. |
... |
additional arguments |
simplify |
a boolean indicating whether to simplify SpotRate creation or not. Defaults to TRUE. |
Details
The character representation of a SpotRate is as follows:
"RATE COMPOUNDING DAYCOUNT CALENDAR"
where:
-
RATEis a numeric value -
COMPOUNDINGis one of the following:simple,discrete,continuous -
DAYCOUNTis a valid day count rule, pex.business/252, see Daycount. -
CALENDARis the name of a bizdays calendar.
simplify check if compounding, daycount and calendar are the same for
all given characters.
If it is true the returned object is a SpotRate otherwise a list with
SpotRate objects is returned.
Value
A SpotRate object created from a string.
Examples
as.spotrate(c(
"0.06 simple actual/365 actual",
"0.11 discrete business/252 actual"
))
[Package fixedincome version 0.0.5 Index]