[R] Is there a way to avoid loading dependendent packages?

Duncan Murdoch murdoch at stats.uwo.ca
Tue Jul 29 01:29:40 CEST 2008

On 28/07/2008 6:42 PM, Paul.Rustomji at csiro.au wrote:
> Hello R help list
> I have been using the smoothScatter function within the "geneplotter"
> package to make some graphs using a Sweave Rnw script called via Rscript
> in a DOS/Windows batch file.  The Rscript will ultimately be called by a
> web service with time-out constraints, hence things need to run as
> swiftly as possible.
> The geneplotter package is currently loaded each time R is invoked and
> has quite a number of dependencies, of which only one (namely Kernsmooth
> package) appears to be necessary for the smoothScatter command to work.
> As loading all these superfluous packages (for my purposes at least)
> takes a bit of time - is there a way to turn off the loading of
> dependent packages so that I can only load the minimum ones I need?  I
> understand I'll be carrying the risk of missing dependencies but in this
> case it is fairly straight forward as to why I need to do this and what
> specific packages are needed.
> Any suggestions?

Presumably everything you need is open source, so you could cut and 
paste together your own package with minimal dependencies.

A big disadvantage in doing this is that it erects a large barrier to 
upgrades:  if geneplotter changes, you'll have a hard time incorporating 
the changes.

In my opinion, you'd get better bang for the buck by buying some new 
hardware that does the same stuff faster, rather than spending the time 
to change the dependencies.

Duncan Murdoch

More information about the R-help mailing list