CITATION.cff
fileThis 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.
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"
)
A CITATION.cff
file and an (invisible) cff
object.
The source that would be used for generating
the cff
object. It could be:
A missing value. That would retrieve the DESCRIPTION
file on your
in-development R package.
An existing cff
object.
The name of an installed package ("jsonlite"
).
Path to a DESCRIPTION
file ("./DESCRIPTION"
).
The name and path of the CITATION.cff
to be created.
List of additional keys to add to the cff
object. See
cff_modify()
.
The Citation File Format schema version that the
CITATION.cff
file adheres to for providing the citation metadata.
Logical TRUE/FALSE
. If the package is hosted on
GitHub, would you like to add the repo topics as keywords?
Logical TRUE/FALSE
. On TRUE
the R package citation
(i.e. inst/CITATION
) would be created or updated.
No backup copy would be created, for more control use
cff_write_citation()
.
Logical TRUE/FALSE
. Would you like to add the
of your package to the references
CFF key?
validate Logical TRUE/FALSE
. Should the new file be
validated using cff_validate()
?
Logical TRUE/FALSE
. On TRUE
the function would display
informative messages.
Roles to be considered as authors of the package when
generating the CITATION.cff
file. See Details.
The name of the encoding to be assumed. Default is "UTF-8"
,
but it can be any other value as accepted by iconv()
, such as
"ASCII//TRANSLIT"
.
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
.
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()
# \donttest{
tmpfile <- tempfile(fileext = ".cff")
cff_obj <- cff_write("jsonlite", outfile = tmpfile)
cff_obj
# Force clean-up
file.remove(tmpfile)
# }
Run the code above in your browser using DataLab