[R] auto-loading package possible?

Robert Gentleman rgentlem at jimmy.harvard.edu
Tue Jul 2 15:05:55 CEST 2002


There is a plan afoot to keep better track of the packages that are
needed for dealing with particular objects (especially if they are
saved and loaded using save and load). I'm hoping to get this in to 
1.6.0.

For now there is no simple way to do this -- you could write your own
simple wrappers around save and load that did this in a brute force
way. 



On Tue, Jul 02, 2002 at 08:29:24AM -0400, Liaw, Andy wrote:
> Dear R-help,
> 
> Yes, I do know about the auto-loading feature.  My question is more
> complicated than that:
> 
> Suppose I loaded a package (e.g., e1071) and created an object of certain
> class (e.g., svm), for which there is a print method in the package to hide
> things that the user may not need to see (e.g., large vectors or matrices
> needed by methods such as predict).  If the next time I started R, I type
> the object name without loading the package first, the whole shebang (sp?)
> gets dumped on the screen, which is quite annoying.  
> 
> Is there any way to make R automagically search for availability of methods
> for a particular class when objects of that class is accessed?  One
> possibility is to auto-load the package if the appropriate method is found.
> Another possibility is to notify the user that a package contains the
> appropriate method and ask if it should be loaded.  Can such a thing be
> done?
> 
> Regards,
> Andy
> 
> Andy I. Liaw, PhD
> Biometrics Research          Phone: (732) 594-0820
> Merck & Co., Inc.              Fax: (732) 594-1565
> P.O. Box 2000, RY84-16            Rahway, NJ 07065
> mailto:andy_liaw at merck.com
> 
> 
> 
> ------------------------------------------------------------------------------
> Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named on this message.  If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it.
> 
> ==============================================================================
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-- 
+---------------------------------------------------------------------------+
| Robert Gentleman                 phone : (617) 632-5250                   |
| Associate Professor              fax:   (617)  632-2444                   |
| Department of Biostatistics      office: M1B28
| Harvard School of Public Health  email: rgentlem at jimmy.dfci.harvard.edu   |
+---------------------------------------------------------------------------+
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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