Hello All,

I am trying to create an S4 class with a slot that is an array.  Below is the 
code I tried but I have missed something.  Any suggestions are appreciated.

setClass("CashFlow",
representation(
CashFlowArray = "array"))

setMethod("initialize",
signature = "CashFlow",
function(.Object,
CashFlowArray = "array"
){
.Object@CashFlowArray
return(.Object)
callNextMethod(.Object,...)
})
CashFlow <-function(CashFlowArray = array()){
new("CashFlow",
CashFlowArray = CashFlowArray)
}

CFTest <- array(data = 2, c(360,8))

Test <- CashFlow(CashFlowArray = CFTest)

Thanks,
Glenn
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to