cff_write {cffr} | R Documentation |
Write a CITATION.cff
file
Description
This is the core function of the package and likely to be the only one you would need when developing a package.
This function writes out a CITATION.cff
file for a given package. This
function is basically a wrapper around cff_create()
to both create the
cff
object and write it out to a YAML-formatted file in
one command.
Usage
cff_write(
x,
outfile = "CITATION.cff",
keys = list(),
cff_version = "1.2.0",
gh_keywords = TRUE,
dependencies = TRUE,
validate = TRUE,
verbose = TRUE,
authors_roles = c("aut", "cre"),
encoding = "UTF-8"
)
Arguments
x |
The source that would be used for generating
the
|
outfile |
The name and path of the |
keys |
List of additional keys to add to the |
cff_version |
The Citation File Format schema version that the
|
gh_keywords |
Logical |
dependencies |
Logical |
validate |
validate Logical |
verbose |
Logical |
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 |
Details
For details of authors_roles
see cff_create()
.
When creating and writing a CITATION.cff
for the first time, the function
adds the pattern "^CITATION\.cff$"
to your .Rbuildignore
file to avoid
NOTE
s and WARNING
s in R CMD CHECK
.
Value
A CITATION.cff
file and an (invisible) cff
object.
See Also
Guide to Citation File Format schema version 1.2.0.
This function unifies the workflow cff_create()
+ cff_validate()
+
write a file.
Other functions for creating external files:
cff_write_bib()
Examples
tmpfile <- tempfile(fileext = ".cff")
cff_obj <- cff_write("jsonlite", outfile = tmpfile)
cff_obj
# Force clean-up
file.remove(tmpfile)