[R] R package organization

Michael Friendly friendly at yorku.ca
Wed Apr 3 16:44:28 CEST 2002


>6)  Better layout of packages listed on CRAN.  This listing
format will
>collapse under its own weight once it gets too large.
>

As a new R user, I have thought for some time that the organization
of packages, and functions within packages, in R needs some more
coherent structure, perhaps something like the hierarchy of classes
used in Perl and contributed to CPAN.  For example, Perl modules
are listed on CPAN organized in a tree containing top-level categories
like

Archiving and Compression
Commercial Software Interfaces
Control Flow Utilities
Data Type Utilities
Database Interfaces
Development Support
File Handle Input Output
  ...
each of these contain numerous subcategories, and there is a
coherent relationship between the subcategories and the directory
structure for installed modules.  So, to use functions to search
for files on my file system, I say

use File::Find;

and if someone writes a new module, say FastCopy.pm it goes into
/usr/lib/perl5/File/FastCopy.pm in my Perl library.

In R, on the other hand, everything goes into R/rw104x/library,
and each pachage contains all its functions within packagename/R,
so there is only a very flat organization across packages
and within packages.

Some packages are quite coherent and relate to a single general
class of methods (John Fox's sem package, for example), while
others are a heterogeneous collection of tools which someone
found useful, and kindly took the effort to document and make public.
 
This makes it quite difficult, sometimes to find a function for
a given task, and I see this reflected both in my own
efforts to use R as well as in many queries on this list, often
answered repeated with a brief

library(foo)
?bar

It also makes it difficult for one person to extend another's
work, e.g., by writing new functions or enhancing others
from an existing package.

This is not a criticism of the R Development Team, but, as
R continues to grow, and more people make contributions to
CRAN, perhaps it is time for some thought to be given to a
reorganization of package structure.

As I look over the list of packages on CRAN, I don't see
any obvious categories, but perhaps others will have some
ideas on this topic.

-Michael

-- 
Michael Friendly              friendly at yorku.ca
York University               http://www.math.yorku.ca/SCS/friendly.html
Psychology Department
4700 Keele Street             Tel:  (416) 736-5115 x66249
Toronto, Ontario, M3J 1P3     Fax:  (416) 736-5814
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list