Johannes Graumann
2008-Feb-18 12:14 UTC
[R] Windows-GUI: "Install Packages from local zip files" and dependencies
Hi, When using the "Packages --> Install packages from local zip files" menu item in the windows-gui: 1) is that supposed to automatically pull in dependencies (in that case I have to fix something in my package). 2) If that's not the default: is there a way to make it so? Thanks, Joh
Duncan Murdoch
2008-Feb-18 12:43 UTC
[R] Windows-GUI: "Install Packages from local zip files" and dependencies
On 18/02/2008 7:14 AM, Johannes Graumann wrote:> Hi, > > When using the "Packages --> Install packages from local zip files" menu > item in the windows-gui: > 1) is that supposed to automatically pull in dependencies (in that case I > have to fix something in my package).No, it doesn't do that. You can see the code it runs by printing utils:::menuInstallLocal It calls install.packages with repos = NULL.> 2) If that's not the default: is there a way to make it so?Not simply, but of course it's possible with some work. The problem is that with repos = NULL, R doesn't know where to look for dependencies. So you need to make two passes: First, install the package, and second, install its dependencies. You can use code like this to find the dependencies: library(tools) allpkgs <- installed.packages() deps <- package.dependencies(allpkgs["test",])[[1]][,1] to find the dependencies of package test after you've installed it, and setdiff(deps, rownames(allpkgs)) to find the ones that are not installed. Where to find them to install is the hard part: are they also local, or on CRAN, or where? Duncan Murdoch
Prof Brian Ripley
2008-Feb-18 12:46 UTC
[R] Windows-GUI: "Install Packages from local zip files" and dependencies
On Mon, 18 Feb 2008, Johannes Graumann wrote:> Hi, > > When using the "Packages --> Install packages from local zip files" menu > item in the windows-gui: > 1) is that supposed to automatically pull in dependencies (in that case I > have to fix something in my package).No (and ?install.packages tells you so).> 2) If that's not the default: is there a way to make it so?No. There is no information available on dependencies unless you set up a local repository. If you want the benfits of a repository, just use a repository. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595