Re: [R] setClass confusion

2013-07-04 Thread David Winsemius
On Jul 3, 2013, at 4:54 PM, Erin Hodgess wrote: Dear R People: I am experimenting with S4 classes and methods but am having trouble with setting up a class. Here is an example: buzz - setClass(buzz,slots=c(x=matrix), + validity - function(object) { +

[R] setClass confusion

2013-07-03 Thread Erin Hodgess
Dear R People: I am experimenting with S4 classes and methods but am having trouble with setting up a class. Here is an example: buzz - setClass(buzz,slots=c(x=matrix), + validity - function(object) { + if(is.matrix(object)==FALSE)stop(Input must be a matrix) + TRUE + }) Error in

Re: [R] setClass confusion

2013-07-03 Thread Duncan Murdoch
On 13-07-03 7:54 PM, Erin Hodgess wrote: Dear R People: I am experimenting with S4 classes and methods but am having trouble with setting up a class. Here is an example: buzz - setClass(buzz,slots=c(x=matrix), + validity - function(object) { + if(is.matrix(object)==FALSE)stop(Input must be