Skip to contents

Plucks one or more mdJSON data dictionaries from an mdJSON file comprised of other types of records.

Usage

extract.mdJSON(x, record.type = "dictionaries", multiple = TRUE)

Arguments

x

List object converted from an mdJSON file.

record.type

Default="dictionaries". String or vector representing the type(s) of records to extract. Additional options include "records" and "contacts".

multiple

Default=TRUE. Whether to allow a selection of multiple records.

Value

Returns a list object corresponding to the mdJSON data dictionary file.

See also

extract.mdJSON()

Examples

# Import mdJSON data dictionary as list
path<-system.file("extdata", "e.g.dictionary2.json", package = "mdJSONdictio")
input.metadata <- rjson::fromJSON(file = path)

# Extract a data dictionary record from a Metadata file
dxnry.record<- extract.mdJSON(x = input.metadata, record.type = "dictionaries")

# Convert list to JSON
output.dxnry = rjson::toJSON(x = dxnry.record)

# Export JSON to disk
write(x = output.dxnry, file = "e.g.dictionary.json")