Re: [R] classes and functions for qqnorm and stem

2010-04-15 Thread Peter Ehlers
On 2010-04-14 21:20, Uwe Dippel wrote: Referring to "Using R for Data Analysis and Graphics" by J H Maindonald, and available from the R site, I found the example on p.30 non-working: > stem(qqnorm(possum$hdlngth)) Error in stem(qqnorm(possum$hdlngth)) : 'x' must be numeric Since qqnorm(possum$h

Re: [R] classes and methods

2009-03-20 Thread Wacek Kusnierczyk
mtmor...@fhcrc.org wrote: >> setClass("foo",representation(x="numeric")) > > This creates an *S4* class which HAS A 'slot' x that is of type numeric. > >>> setMethod("plot","foo",function(x,y,...)boxplot(x,...)) >>> x <- rnorm(100) >>> class(x) <- "foo" > > uh oh, this is creating an *S3* class tha

Re: [R] classes and methods

2009-03-19 Thread mtmorgan
Hi Edna -- Quoting Edna Bell : I have put together a test class and methods setClass("foo",representation(x="numeric")) [1] "foo" This creates an *S4* class which HAS A 'slot' x that is of type numeric. setMethod("plot","foo",function(x,y,...)boxplot(x,...)) [1] "plot" x <- rnorm(100)

Re: [R] Classes

2008-11-17 Thread Martin Maechler
> "N" == Nick <[EMAIL PROTECTED]> > on Sat, 15 Nov 2008 13:39:44 -0800 (PST) writes: N> Code: # svm is an S3 class, so: setOldClass("svm") N> # Create the super class model: setClass("model") N> # For svm from e1071 this works (well gives no error): N> setIs("svm", "