Learn R Programming

bitfield (version 1.0.0)

bf_export: Export bitfield registries

Description

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

Usage

bf_export(registry, format, file = NULL)

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.

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.

Examples

Run this code
if (FALSE) {
# 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",
                   template = bf_tbl,
                   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")
}

Run the code above in your browser using DataLab