cff: Create 'cff' objects from direct inputs

View source: R/cff.R

cffR Documentation

Create cff objects from direct inputs

Description

A class and utility methods for reading, creating and storing CFF information. See cff_class to learn more about cff objects.

Usage

cff(path, ...)

Arguments

path

[Deprecated] path is no longer supported, use cff_read_cff_citation() instead.

...

Named arguments used to create a cff object. If no arguments are supplied (the default behavior), a minimal valid cff object is created.

Details

cff() converts ⁠_⁠ in the argument name to -. For example, cff_version = "1.2.0" is converted to cff-version = "1.2.0".

Valid arguments are those specified on cff_schema_keys():

  • cff-version

  • message

  • type

  • license

  • title

  • version

  • doi

  • identifiers

  • abstract

  • authors

  • preferred-citation

  • repository

  • repository-artifact

  • repository-code

  • commit

  • url

  • date-released

  • contact

  • keywords

  • references

  • license-url

Value

A cff object. Under the hood, a cff object is a regular base::list() object with a special print method.

See Also

Core cffr workflow: cff_create(), cff_modify(), cff_validate(), cff_write()

Examples

# Blank `cff` object.
cff()

# Use custom parameters.
test <- cff(
  title = "Manipulating files",
  keywords = c("A", "new", "list", "of", "keywords"),
  authors = as_cff_person("New author")
)
test

# This would fail.
cff_validate(test)


# Modify with cff_create().
new <- cff_create(test, keys = list(
  "cff_version" = "1.2.0",
  message = "A blank file"
))
new

# This would pass.
cff_validate(new)

cffr documentation built on Aug. 24, 2026, 5:11 p.m.