| cff_write | R Documentation |
CITATION.cff filecff_write() is the primary workflow for package development.
This function writes a CITATION.cff file for a given package. It wraps
cff_create() to create the cff object, then writes it to a
YAML-formatted file in one command.
cff_write(
x,
outfile = "CITATION.cff",
keys = list(),
cff_version = "1.2.0",
gh_keywords = TRUE,
r_citation = FALSE,
dependencies = TRUE,
validate = TRUE,
verbose = TRUE,
authors_roles = c("aut", "cre"),
encoding = "UTF-8"
)
x |
The source used to generate the
|
outfile |
The name and path of the |
keys |
A list of additional keys to add to the |
cff_version |
The Citation File Format schema version used for the generated metadata. |
gh_keywords |
A logical value. If |
r_citation |
A logical value. If |
dependencies |
A logical value. If |
validate |
A logical value. If |
verbose |
A logical value. If |
authors_roles |
Roles to be considered as authors of the package when
generating the |
encoding |
The name of the encoding to be assumed. Default is |
For details of authors_roles, see cff_create().
The x argument identifies the metadata source. It does not determine the
output directory. This allows you to create a CITATION.cff from a package
or file located outside the current working directory.
When creating and writing a CITATION.cff for a package in the current
working directory, this function adds the pattern "^CITATION\.cff$" to
the local .Rbuildignore file.
Invisibly returns the generated cff object. This function is called
primarily for its side effect of writing a CITATION.cff file.
Citation File Format schema guide.
Core cffr workflow:
cff(),
cff_create(),
cff_modify(),
cff_validate()
Write citation metadata files:
cff_write_bib()
tmpfile <- tempfile(fileext = ".cff")
cff_obj <- cff_write("jsonlite", outfile = tmpfile)
cff_obj
# Force cleanup.
file.remove(tmpfile)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.