Skip to content

SpotRateCurve [ operator raises an error with NA #24

Description

@wilsonfreitas
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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions