A number of different operations can be performed on or with InterestRate objects. Methods have been defined for base package generic operations including arithmetic and comparison.

Details

The operations are:

  • c: concatenates a vector of InterestRate objects

  • [: extract parts of a InterestRate vector

  • [<-: replace parts of a InterestRate vector

  • rep: repeat a InterestRate object

  • length: determines the length of a InterestRate vector

  • +, -: addition/subtraction of InterestRate objects. Where two InterestRate objects are added/subtracted, the second is first converted to have the same compounding and day basis frequency as the first. Numeric values can be added/subtracted to/from an InterestRate object by performing the operation directly on the rate field. Arguments are recycled as necessary.

  • *: multiplication of InterestRate objects. Where two InterestRate objects are multiplied, the second is first converted to have the same compounding and day basis frequency as the first. Numeric values can be multiplied to an InterestRate object by performing the operation directly on the rate field. Arguments are recycled as necessary.

  • /: division of InterestRate objects. Where two InterestRate objects are divided, the second is first converted to have the same compounding and day basis frequency as the first. Numeric values can divide an InterestRate object by performing the operation directly on the rate field. Arguments are recycled as necessary.

  • <, >, <=, >=, ==, !=: these operate in the standard way on the rate field, and if necessary, the second InterestRate object is converted to have the same compounding and day basis frequency as the first.