I'd like to return the package license as declared in the DESCRIPTION file of an R package (ideally I'd rather have the URL that CRAN automatically adds to all the common licenses it recognizes).
I realize I can get the license R itself is distributed under with
license()
which amazingly doesn't apply to packages; e.g. license("packagename")
Nor is this data returned by a call to citation("packagename")
.
you are looking for
packageDescription
eg:
If you want to get the licenses for all installed packages, then use the
installed.packages
command.Borrowing from the help page for this command:
To output the licenses to a csv file: