From Jonathan.Swinton at astrazeneca.com  Fri Feb 27 15:36:31 2004
From: Jonathan.Swinton at astrazeneca.com (Swinton, Jonathan)
Date: Fri Feb 27 15:37:39 2004
Subject: [Rd] package 'stats' needs import directive for 1.9.0?
Message-ID: <FCA5F290CE7FFD42A6F1515497B0F0A203438F32@ukapphresmsx02.ukapd.astrazeneca.net>



> From: Prof Brian Ripley <ripley@stats.ox.ac.uk>
> Subject: Re: [Rd] package 'stats' needs import directive for 1.9.0?
> To: "Heywood, Giles" <Giles.Heywood@CommerzbankIB.com>
> Cc: R-devel@stat.math.ethz.ch
... 
> I suggest you don't try: there are already quite a few 1.9.0-specific 
> versions of packages on CRAN, and 1.8.x will be history in a 
> couple of 
> months.
> 
I'm not sure I understand the advice here. I have also hit the same problem,
and it seems reasonable to me to aspire to maintain a single package which
works on both 1.8.x and 1.9.x. 

> On Thu, 26 Feb 2004, Heywood, Giles wrote:
> 
> > I maintain the Irregular Time Series (its) package on CRAN. 
>  I am currently
> > testing a release.  Under 1.8.1 I am able to define a S4 
> generic 'start' as
> > follows:
> > 
> > if(!isGeneric("start")) {setGeneric("start", useAsDefault=start)}
> 
> Why do you need to do that?  You could just define an S4 
> method which will 
> automatically make a generic if needed.

I think that explicit Genericisation (?) has virtues from the point of view
of code legibility.
...
> 
> > However, the additional directive leads to problems under 
> 1.8.1, as one
> > might expect, since 'stats' does not exist under 1.8.1.  
> How to define my S4
> > generic and make it transparent so that the base function start() is
> > unaffected, in such a way that it will function under 1.8.1 
> and 1.9.0?
> > 
My solution was to only do a require(stats)  if running > 1.9.


[Rd] package 'stats' needs import directive for 1.9.0?
Swinton, Jonathan