From cbeleites at units.it  Sun May 30 17:08:28 2010
From: cbeleites at units.it (Claudia Beleites)
Date: Sun, 30 May 2010 17:08:28 +0200
Subject: [Rd] S4 dispatch for .DollarNames (utils)
In-Reply-To: <4C01845E.5080102@r-project.org>
References: <4C00F8C2.4060508@r-enthusiasts.com>	<AANLkTimkEzQ5GLpnWHJr1EuBcNBmwod81UzBFs0fXusk@mail.gmail.com>	<4C016CE3.8050403@r-enthusiasts.com>
	<4C01845E.5080102@r-project.org>
Message-ID: <httv0n$4pr$1@dough.gmane.org>

Dear all,

thank your for this discussion - I had been wondering how to get the completion 
with my S4 class, but it didn't bother me enough to dig into things.

> The workaround/hack that *does* work now, I believe, is to insert a 
> dummy S3 class into the mix and define the S3 .DollarNames method for it.
> 
> Example:
>  > setOldClass("foo3")
>  > .DollarNames.foo3 <- function(x, pattern)"bar"

My question here is: what is the dummy class needed for?

I have a few S3 methods for my S4 class (rbind.hyperSpec, cbind.hyperSpec, and 
now .DollarNames.hyperSpec). They seem to work just fine without first setting 
up a dummy S3 class that is then used in the contains of the S4 definition.
Any pitfalls with that?

Claudia



-- 
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Universit? degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbeleites at units.it



[Rd] S4 dispatch for .DollarNames (utils)
Claudia Beleites