From renaud at mancala.cbio.uct.ac.za  Tue Oct  5 14:34:43 2010
From: renaud at mancala.cbio.uct.ac.za (Renaud Gaujoux)
Date: Tue, 05 Oct 2010 14:34:43 +0200
Subject: [Rd] library: loading of required packages and argument 'lib.loc'
Message-ID: <4CAB1B63.3040607@cbio.uct.ac.za>

Hi,

is there a reason why when calling the argument 'lib.loc' of library() 
is not used when trying to load the required packages?

0. Package A depends on package B
1. Install packages A and B in a subdirectory 'lib' of the current directory
2. Call:

library(A, lib.loc='./lib')

This will give something like the following:

Loading required package: B
Error: package 'B' could not be loaded
In addition: Warning message:
In library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = 
lib.loc) :
   there is no package called 'B'

In function library there the call '.getRequiredPackages2(pkgInfo)' 
loads the required packages but do not pass the argument lib.loc 
(whereas .getRequiredPackages2 has an argument for this).
I know a quick work around for this is to put './lib' into .libPaths but 
it would be nice if library() could do it locally (e.g. pass the 
argument), without changing the global settings.

Thanks,
Renaud


 

###
UNIVERSITY OF CAPE TOWN 

This e-mail is subject to the UCT ICT policies and e-mail disclaimer published on our website at http://www.uct.ac.za/about/policies/emaildisclaimer/ or obtainable from +27 21 650 4500. This e-mail is intended only for the person(s) to whom it is addressed. If the e-mail has reached you in error, please notify the author. If you are not the intended recipient of the e-mail you may not use, disclose, copy, redirect or print the content. If this e-mail is not related to the business of UCT it is sent by the sender in the sender's individual capacity.

###



[Rd] library: loading of required packages and argument 'lib.loc'
Renaud Gaujoux