# \donttest{
# Full `.cff` example.
cff_validate(system.file("examples/CITATION_complete.cff", package = "cffr"))
# Validate a `cff` object.
cffr <- cff_create("jsonlite")
class(cffr)
cff_validate(cffr)
# }
# `.cff` with errors.
err_f <- system.file("examples/CITATION_error.cff", package = "cffr")
# You can manipulate the errors as a data frame.
res <- try(cff_validate(err_f))
isTRUE(res)
isFALSE(res)
# Detailed results.
df_errors <- attr(res, "errors")
df_errors[, c("field", "message")]
# An R citation file is not a `.cff` file, so it throws an error.
try(cff_validate(system.file("CITATION", package = "cffr")))
Run the code above in your browser using DataLab