purl() builds a Package URL (purl) for an R package. cran_doi() builds
the DataCite DOI that CRAN assigns to each package.
Usage
purl(
name,
version = NA,
source = "cran",
namespace = NULL,
repository_url = NULL
)
cran_doi(pkg)Arguments
- name
Package names, as a character vector.
- version
Package versions, as a character vector.
NAor""omits the version.- source
Where the package comes from:
"cran","github","gitlab"or"bitbucket".- namespace
Owner of the source repository. Required when
sourceis"github","gitlab"or"bitbucket".- repository_url
Optional repository URL, written unencoded as a
repository_urlqualifier. Use this for packages from repositories other than CRAN, such as Bioconductor, or from a GitHub Enterprise or GitLab server of one's own.- pkg
Package names, as a character vector.
Value
A character vector. purl() recycles name, version,
namespace and repository_url to a common length: each must have
length 1 or the length of the longest, otherwise it is an error.