[R] Loading a "sub-package"

(Ted Harding) Ted.Harding at nessie.mcc.ac.uk
Tue Oct 28 19:23:42 CET 2003


Hi Folks,

The inspiration for this query is described below, but it
prompts a general question:

If one wants to use only one or a few functions from a library,
is there a way to load only these, without loading the library,
short of going into the package source and extracting what is
needed (including of course any auxiliary functions and compiled
code they may depend on)?

What prompted this is that I needed to simulate some MVnormal data.
There's a useful function 'mvrnorm' which does just that, in the
library/package MASS. So that's what I used.

But MASS is huge! Hence the query. (I've also had occasion to filch
single functions from other libraries as well).

(Of course, in reality I've noticed that 'mvrnorm' is a few lines
of pure R code which can easily be lifted out and run "stand-alone",
so the issue is not really a problem in this case. But I think the
question is a good one, well exemplified by the case described.)

With thanks,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 167 1972
Date: 28-Oct-03                                       Time: 18:23:42
------------------------------ XFMail ------------------------------




More information about the R-help mailing list