as_json: Coerce an emld object into JSON

Description Usage Arguments Details Value Examples

Description

Coerce an emld object into JSON

Usage

1

Arguments

x

an emld object

file

optional path to write out to file. Otherwise, defaults to NULL and will return a json object.

Details

Note: since emld list object maintains a 1:1 correspondence with JSON, following the conventions of jsonlite, this function is basically trivial. The only purpose is to default to auto_unbox = TRUE in serializing lists to JSON.

Value

a json object. Or if a file path is provided, the metadata is written out in JSON file and the function returns NULL invisibly.

Examples

1
2
3
4
5
6
f <- system.file("extdata/example.xml", package = "emld")
emld <- as_emld(f)
json <- as_json(emld)
## can also write a json file to disk:
json_file <- tempfile()
as_json(emld, json_file)

cboettig/emld documentation built on June 9, 2019, 8:38 a.m.