Export bitfield registries in DataCite-compliant formats for archiving, sharing, and integration with metadata repositories.

bf_export(registry, format, file = NULL)

Arguments

registry

registry(1)
Registry object to export.

format

character(1)
Export format. One of "json", "xml", "yaml", or "rds".

file

character(1)
Optional file path to write the output. If NULL, returns the formatted data.

Value

Exported data as character string for formatted outputs, or the registry object for "rds" format. If file is specified, returns invisibly and writes to file.

Examples

if (FALSE) { # \dontrun{
# Create registry with metadata
auth <- person("Jane", "Smith", email = "jane@example.com",
               comment = c(ORCID = "0000-0000-0000-0000"))
reg <- bf_registry(name = "analysis",
                   description = "Data quality assessment",
                   author = auth)

# Export to different formats
bf_export(registry = reg, format = "json", file = "metadata.json")
bf_export(registry = reg, format = "xml", file = "metadata.xml")
yaml_output <- bf_export(registry = reg, format = "yaml")
} # }