Rev 88907 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/tools/man/licensetools.Rd% Part of the R package, https://www.R-project.org% Copyright 2025 R Core Team% Distributed under GPL 2 or later\name{licensetools}\alias{analyze_license}\title{License Tools}\description{Tools for computing on license specifications.}\usage{analyze_license(x)}\arguments{\item{x}{a character string.}}\details{R packages use the \samp{License} field in their \file{DESCRIPTION}file to specify their license in a standardized form described inSection \manual{R-exts}{Licensing}.This uses alternatives of individual specifications(\sQuote{components}) which can use version restrictions or givepointers to \file{LICENSE} (or \file{LICENCE}) files eitherrestricting the base license or giving a full license.Function \code{analyze_license()} checks if a given character stringprovides such a standardized license spec (or something recognized asa historic exception which can be transformed to a standardized spec).If standardizable, it extracts the individual components and wherethese give version ranges the corresponding expansions into componentswith fixed versions. It also indicates whether the license can beverified to be \abbr{FOSS}(\url{https://en.wikipedia.org/wiki/Free_and_open-source_software})licenses and where possible computes an\href{https://spdx.dev/learn/handling-license-info/}{\abbr{SPDX}license identifier}for the license.}\value{a list with elements including\item{is_canonical}{a logical indicating whether the given stringis a standardized license spec.}\item{is_standardizable}{a logical indicating whether the given stringis a standardized license spec, or can be transformed to one.}\item{standardization}{a character string giving the standardizedlicense spec corresponding to the given string if this isstandardizable.}\item{components}{the components of the standardized license spec.}\item{expansions}{the expansions of the components of the standardizedlicense spec.}\item{is_verified}{a logical indicating whether the given string canbe verified to specify a \abbr{FOSS} license.}\item{spdx}{an \abbr{SPDX} license identifier for the license spec.}}\examples{## Examples from section 'Licensing' of 'Writing R Extensions':analyze_license("GPL-2")analyze_license("LGPL (>= 2.0, < 3) | Mozilla Public License")analyze_license("GPL-2 | file LICENCE")analyze_license("GPL (>= 2) | BSD_3_clause + file LICENSE")analyze_license("Artistic-2.0 | AGPL-3 + file LICENSE")}