| cff_validate | R Documentation |
CITATION.cff file or a cff objectValidate a CITATION.cff file or a cff object using the corresponding validation schema.
cff_validate(x = "CITATION.cff", verbose = TRUE)
x |
This is expected to be either a full |
verbose |
Logical |
A message indicating the result of the validation and an invisible value
TRUE/FALSE. On error, the results would have an attribute "errors"
containing the error summary (see Examples and attr()).
Guide to Citation File Format schema version 1.2.0.
jsonvalidate::json_validate(), that is the function that performs the
validation.
Other core functions of cffr:
cff(),
cff_create(),
cff_modify()
# Full .cff example
cff_validate(system.file("examples/CITATION_complete.cff", package = "cffr"))
# Validate a cffr object
cffr <- cff_create("jsonlite")
class(cffr)
cff_validate(cffr)
# .cff with errors
err_f <- system.file("examples/CITATION_error.cff", package = "cffr")
# Can manipulate the errors as data frame
res <- try(cff_validate(err_f))
isTRUE(res)
isFALSE(res)
attr(res, "errors")
# If a CITATION file (note that is not .cff) it throws an error
try(cff_validate(system.file("CITATION", package = "cffr")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.