From fparlamis at mac.com  Wed Oct 11 02:53:00 2006
From: fparlamis at mac.com (Parlamis Franklin)
Date: Tue, 10 Oct 2006 14:53:00 -1000
Subject: [Rd] dispatching on group generics with more than one formal
Message-ID: <6FB8311F-57A3-4FFB-BAF2-B49A9A3442CB@mac.com>

please see the code below.  foo2 fails to dispatch correctly, but foo  
does fine.  i have tried 'cacheMetaData(1)' and a number of different  
variants of 'cacheGenericsMetaData', on the possibility there is a  
caching issue.  but i still can't sort it out.

also one general question: does it really matter what's in the body  
of the function definition in a 'setGroupGeneric' call?  the actual  
group function definition is always overwritten by a message to the  
effect the function should not be called directly.
__

setGroupGeneric("Foo", function(x) standardGeneric("Foo"))
setGroupGeneric("Foo2", function(x, y) standardGeneric("Foo2"))
setGeneric("foo", function(x) standardGeneric("foo"),
	group = "Foo", useAsDefault = function(x) "Default")
setGeneric("foo2", function(x, y) standardGeneric("foo2"),
	group = "Foo2", useAsDefault = function(x, y) "Default2")
setMethod("Foo", signature(x = "numeric"), function(x) "Special")
setMethod("Foo2", signature(x = "numeric", y = "missing"),
	function(x, y) "Special2")	
foo(1)  # gives the group method
foo2(1) # gives the default method
selectMethod("foo2", signature(x = "numeric", y = "missing")) # but  
method selection appears to work correctly

__

franklin parlamis

 > version

platform       powerpc-apple-darwin8.7.0
arch           powerpc
os             darwin8.7.0
system         powerpc, darwin8.7.0
status
major          2
minor          4.0
year           2006
month          10
day            03
svn rev        39566
language       R
version.string R version 2.4.0 (2006-10-03)




[Rd] dispatching on group generics with more than one formal
Parlamis Franklin