Allan Engelhardt
2010-Jul-27 11:17 UTC
[R] Checking package licences including dependencies?
I only recently discovered options("available_packages_filters" = list(add = TRUE, "license/FOSS")) [cf. help("available.packages", package="utils") in R 2.10.0 or later] which goes nicely with my options("checkPackageLicense" = TRUE) [new in R 2.11]. But now I want to purge my library of packages I would not have installed had I known about this option earlier (I'm looking at you, "gam"!). Short of erasing the whole directory of libraries and re-installing it, is there an easy way of achieving this? I could probably roll something based on tools:::analyze_license() but I think the erase-and-reinstall option might be easier in this case :-) Allan
Allan Engelhardt <allane <at> cybaea.com> writes:> > I only recently discovered options("available_packages_filters" = > list(add = TRUE, "license/FOSS")) [cf. help("available.packages", > package="utils") in R 2.10.0 or later] which goes nicely with my > options("checkPackageLicense" = TRUE) [new in R 2.11]. > > But now I want to purge my library of packages I would not have > installed had I known about this option earlier (I'm looking at you, > "gam"!).What's the problem with gam? The ACM license on akima (on which it depends) that requires permission/licensing for commercial use?
Gabor Grothendieck
2010-Jul-27 13:48 UTC
[R] Checking package licences including dependencies?
On Tue, Jul 27, 2010 at 7:17 AM, Allan Engelhardt <allane at cybaea.com> wrote:> I only recently discovered options("available_packages_filters" = list(add > TRUE, "license/FOSS")) [cf. help("available.packages", package="utils") in R > 2.10.0 or later] which goes nicely with my options("checkPackageLicense" > TRUE) [new in R 2.11]. > > But now I want to purge my library of packages I would not have installed > had I known about this option earlier (I'm looking at you, "gam"!). > > Short of erasing the whole directory of libraries and re-installing it, is > there an easy way of achieving this? > > I could probably roll something based on tools:::analyze_license() but I > think the erase-and-reinstall option might be easier in this case :-) >Try this: License <- installed.packages()[, "License"] View(License) and then just delete the ones you don't want or write a simple function which examines License and issues a remove.packages() for those that match or don't match whatever you want.
Prof Brian Ripley
2010-Jul-27 15:31 UTC
[R] Checking package licences including dependencies?
If I understand you correctly, set the filter and use packageStatus(). Its summary() method tells you which packages you have installed which are 'unavailable'. E.g. my Mac (with pkgType = "source") shows in R-devel summary(packageStatus(.libPaths()[1]))$Libs[[1]]$unavailable [1] "BayesX" "EVER" "TSA" "akima" "degreenet" "difR" [7] "ergm" "ff" "gam" "isa2" "latentnet" "locfit" [13] "mapproj" "rtiff" "statnet" "tripack" On Tue, 27 Jul 2010, Allan Engelhardt wrote:> I only recently discovered options("available_packages_filters" = list(add = > TRUE, "license/FOSS")) [cf. help("available.packages", package="utils") in R > 2.10.0 or later] which goes nicely with my options("checkPackageLicense" = > TRUE) [new in R 2.11]. > > But now I want to purge my library of packages I would not have installed had > I known about this option earlier (I'm looking at you, "gam"!). > > Short of erasing the whole directory of libraries and re-installing it, is > there an easy way of achieving this? > > I could probably roll something based on tools:::analyze_license() but I > think the erase-and-reinstall option might be easier in this case :-) > > Allan > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- 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