[R] now S4 classes and packages

2011-02-22 Thread Laura Smith
Hi again List: This time I have the following: setClass(dog,representation(breed=numeric)) [1] dog woof - function(x=1:10) { + if(!is.numeric(x))stop(Must have numeric data) + y - new(dog,breed=x) + return(y) + } setMethod(plot,dog, + function(x,y,...) { + plot(x@breed,col=blue,type=l) + } + )

Re: [R] now S4 classes and packages

2011-02-22 Thread Uwe Ligges
On 22.02.2011 09:15, Laura Smith wrote: Hi again List: This time I have the following: setClass(dog,representation(breed=numeric)) [1] dog woof- function(x=1:10) { + if(!is.numeric(x))stop(Must have numeric data) + y- new(dog,breed=x) + return(y) + } setMethod(plot,dog, +