[R] Checking package licences including dependencies?

Gabor Grothendieck ggrothendieck at gmail.com
Tue Jul 27 17:01:52 CEST 2010


On Tue, Jul 27, 2010 at 9:48 AM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
> 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.
>

Just one caveat.  I believe its possible for the filter you mention to
exclude a FOSS package if it uses
   License: file LICENSE
in the DESCRIPTION file and then puts the license info in the LICENSE
file.  This might happen if the package had several components each of
which were FOSS yet have different FOSS licenses.  Thus if you want to
be comprehensive you really have to examine each package you are
excluding to be sure that you are not excluding something that you
would be willing to keep.



More information about the R-help mailing list