I am trying to figure out, why the code below throws the error:
Error in .local(.Object, ...) : argument "data" is missing, with no default
Problem Code:
setClass("A", representation(a="numeric"), "VIRTUAL")
setClass("B", representation(b="numeric"), contains="A")
setMethod("initialize", "A", function(.Object, data){
.Object@a <- data[1]
})
setMethod("initialize", "B", function(.Object, data){
.Object@b <- data[2]
callNextMethod()
})
data <- 1:2
new("B", data)
Thank you for your help!