I got an error while creating a new method for a new class
> setClass("CIR", representation(PATH="numeric", GRID="numeric", PARAMS="numeric"));
[1] "CIR"
>
> setMethod("plot", signature(x="CIR"), ,
+ function(x) {
+ plot(slot(x,"GRID"),slot(x,"PATH"),type="l")
+ points(slot(x,"GRID"),slot(x,"PATH"),col="red",cex=0.5)
+ })
Error in as.environment(where) : invalid object for 'as.environment'
How can I solve it? Thanks!