0

I have made all my functions into generics and methods on their respective classes.
But now what worked as functions no longer works.

Class bond.id has no generic or methods.
It only holds variables that are passed to a, b, and c, each of these all call bond.id@...

Fine no problem a, b, and c work as they are supposed to using new(" ",...)

When everything was a function and not a method on a class the last step was a class(z) that inherited a, b, and c.
This worked.
But now when I setClass("z", contains = c(a, b, c)) I get the following error:

Error in .local(.Object, ...) : argument "bond.id" is missing, with no default

I am a little perplexed if a, b, c are working why is the setClass for z behaving this way?

UseR10085
  • 7,120
  • 3
  • 24
  • 54
no name
  • 245
  • 2
  • 14
  • Please provide a [small but complete reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – digEmAll Oct 27 '13 at 13:54
  • 1
    I wish I could but then I would have to create five classes, three generics, three methods, and a datafile object. I think I may just give up. Every turn in R presents and obstacle. Maybe there is a better language to do this. – no name Oct 27 '13 at 18:36
  • It seems a simple error to me, you simply forgot to specify a necessary argument called `bond.id` somewhere... but it's really hard to say without seeing the actual code. – digEmAll Oct 27 '13 at 19:38
  • BTW you can use [pastebin](http://pastebin.com/) to post long pieces of code... – digEmAll Oct 27 '13 at 19:41
  • That's what I thought but each method works on its own. The error occurs when I try to create a class that contains each class. setClass("BondAnalytics", contains = c("BondDetails", BondCashFlows")) I get the error and when I traceback it goes to:function (.Object, bond.id, principal, settlement.date, price) { library(lubridate) issue.date = as.Date(bond.id@IssueDate, "%m-%d-%Y") start.date = as.Date(bond.id@DatedDate, "%m-%d-%Y") This all worked fine until I created generics and methods on the classes. Oh well... – no name Oct 27 '13 at 19:48

0 Answers0