Re: [Rd] setMethod("Logic", ...)

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri 01 Sep 2006 - 15:45:45 GMT

Accordng to the S4groupGeneric page, there is no such group.

My guess as to why:

Those operators are not S3 generic in R, and S4 dispatch is piggy-backed on S3 dispatch (not necessarily, but for convenience).

On Fri, 1 Sep 2006, Robin Hankin wrote:

> Hi
>
>
> In V&R the "polynomial" class is explicitly specified to have no
> logical operators:
>
> setMethod("Logic", signature(e1="polynomial"), function(e1,e2){stop
> ("...")})
>
>
> I too have a class of objects for which I want to
> specify that Logic operators do not work, but executing
>
>
>
> setClass("brob",
> representation = representation
> (x="numeric",positive="logical"),
> prototype = list(x=numeric(),positive=logical())
> )
>
> setMethod("Logic",signature(e1="brob"), function(e1,e2)
> {
> stop("No logic currently implemented for brob objects")
> }
> )
>
>
> gives me
>
>
> Error in setMethod("Logic", signature(e1 = "brob"), function(e1, e2) { :
> no existing definition for function 'Logic'
>
>
> ?Math seems to imply that there is no "Logic" group.
>
> So, what is the correct way to specify that logical operations are
> not allowed for "brob" objects?
>
>
>
>
>
> --
> Robin Hankin
> Uncertainty Analyst
> National Oceanography Centre, Southampton
> European Way, Southampton SO14 3ZH, UK
> tel 023-8059-7743
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Sat Sep 02 01:48:06 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 06 Sep 2006 - 11:39:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.