[Rd] Wishlist: Make screeplot() a generic (PR#9541)

Gavin Simpson gavin.simpson at ucl.ac.uk
Sat Mar 17 14:02:29 CET 2007


Dear List

Having not received any comments for or against my proposal to make
screeplot() a generic function, I found some time to make the relevant
changes to the svn trunk repository (revision 40848).

Please find attached a patch against the R svn trunk sources including
changes to the relevant help files and NAMESPACE. This builds and passes
make check-devel out of the box on my FC4 machine.

I took the option of making the default method for screeplot the
existing function and the plot methods for princomp and prcomp both call
screeplot.default directly. This, I hope, preserves the current
behaviour and should be backwards compatible with
code/packages/examples/docs that use these functions.

One alternative would be to have explicit methods for classes "prcomp"
and "princomp" that extract the relevant variances and pass on to
screeplot.default for plotting. If this is preferred I can provide a
patch for this scenario for consideration?

All the best,

Gav

On Fri, 2007-03-02 at 17:53 +0100, gavin.simpson at ucl.ac.uk wrote:
> Full_Name: Gavin Simpson
> Version: 2.5.0
> OS: Linux (FC5)
> Submission from: (NULL) (128.40.33.76)
> 
> 
> Screeplots are a common plot-type used to interpret the results of various
> ordination methods and other techniques. A number of packages include ordination
> techniques not included in a standard R installation. screeplot() works for
> princomp and prcomp objects, but not for these other techniques as it was not
> designed to do so. The current situation means, for example, that I have called
> a function Screeplot() in one of my packages, but it would be easier for users
> if they only had to remember to use screeplot() to generate a screeplot.
> 
> I would like to request that screeplot be made generic and methods for prcomp
> and princomp added to R devel. This way, package authors can provide screeplot
> methods for their functions as appropriate.
> 
> I have taken a look at the sources for R devel (from the SVN repository) in file
> princomp-add.R and prcomp.R and it looks a relatively simple change to make
> screeplot generic.
> 
> I would be happy to provide patches and documentation if R Core were interested
> in making this change - I haven't done this yet as I don't want to spend time
> doing something that might not be acceptable to R core in general.
> 
> Many thanks,
> 
> G

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Gavin Simpson                     [t] +44 (0)20 7679 0522
ECRC                              [f] +44 (0)20 7679 0565
UCL Department of Geography
Pearson Building                  [e] gavin.simpsonATNOSPAMucl.ac.uk
Gower Street
London, UK                        [w] http://www.ucl.ac.uk/~ucfagls/
WC1E 6BT                          [w] http://www.freshwaters.org.uk/
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screeplot.patch
Type: text/x-patch
Size: 3978 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-devel/attachments/20070317/46171f2e/attachment.bin 


More information about the R-devel mailing list