From seth at userprimary.net  Tue Sep 22 23:12:57 2009
From: seth at userprimary.net (Seth Falcon)
Date: Tue, 22 Sep 2009 14:12:57 -0700
Subject: [Rd] Rcmdr package dependencies
In-Reply-To: <4AB91497.4020505@statistik.tu-dortmund.de>
References: <002001ca3b86$cda835d0$68f8a170$@ca>
	<4AB91497.4020505@statistik.tu-dortmund.de>
Message-ID: <20090922211257.GB203@orange.local>

* On 2009-09-22 at 20:16 +0200 Uwe Ligges wrote:
> no, this is not possible.
> 
> Consider your package A (or Rcmdr) suggests B that suggests C.
> Then A::foo uses the function B::bar which only works if C::dep is
> present. B works essentially without C but it requires C just to
> make bar work. Then this means your A::foo won't work if C is not
> installed and you won't get it with the setup mentioned above.
> 
> In summary, I fear what you want might work well *now* (by chance),
> but it does not work in general.

In general, one would expect a given package to function when its
suggested packages are not available.  As such, it seems quite
reasonable to install a package, its Depends, Imports, and Suggests,
but not install Suggests recursively.

I think you could achieve such an installation using two calls to
install.packages:

install.packages("Rcmdr")
Rcmdr.Suggests <- strsplit(packageDescription("Rcmdr")$Suggests, ",\\s?")[[1]]
## need extra cleanup since packageDescription("blah")$Suggests
## Returns package names with versions as strings
wantPkgs <- sub("^([^ ]+).*", "\\1", Rcmdr.Suggests)
havePkgs <- installed.packages()[, "Package"]
wantPkgs <- wantPkgs[!(wantPkgs %in% havePkgs)]
install.packages(wantPkgs)

+ seth

-- 
Seth Falcon | @sfalcon | http://userprimary.net/user



[Rd] Rcmdr package dependencies
Seth Falcon