[R] auto-loading package possible?

Liaw, Andy andy_liaw at merck.com
Tue Jul 2 14:29:24 CEST 2002

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


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

More information about the R-help mailing list