Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpotRateCurve [ operator raises an error with NA #24

Open
wilsonfreitas opened this issue Jul 6, 2022 · 0 comments
Open

SpotRateCurve [ operator raises an error with NA #24

wilsonfreitas opened this issue Jul 6, 2022 · 0 comments

Comments

@wilsonfreitas
Copy link
Owner

wilsonfreitas commented Jul 6, 2022

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.

@wilsonfreitas wilsonfreitas changed the title SpotRateCurve [ operator raises an error with NA SpotRateCurve [ operator raises an error with NA Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant