library(fixedincome)
crv <- spotratecurve(
c(0.1315, 0.1319, 0.1338, 0.1348, 0.1372, 0.1381),
c(1, 21, 42, 63, 126, 252),
"discrete", "business/252", "Brazil/ANBIMA",
refdate = Sys.Date()
)
crv[c(1, NA, 5)]
#> Error in validObject(.Object): invalid class "SpotRateCurve" object: FALSE
This could return NA elements instead of raising an error.
This could return NA elements instead of raising an error.