aml_to_json: Convert AML to JSON

Description Usage Arguments Value References See Also Examples

Description

This imports data from New York Times' ArchieML format as a JSON sting. Text is parsed to JSON using archieml-js.

Usage

1
aml_to_json(aml, pretty = FALSE, indent = 4)

Arguments

aml

a string, file, connection, URL, or Google Drive ID created by googledrive::as_id from which to read ArchieML. Inputs of length > 1, with line breaks, or non-existent filenames will always be treated as raw ArchieML. To read multiple ArchieML inputs use a function such as lapply.

pretty

prettify JSON output?

indent

if prettifying, what indent level? Passed to prettify.

Value

A length-1 character vector of class "json"

References

http://archieml.org/

See Also

from_aml

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
aml_to_json(aml = "key: value")
aml_to_json("http://archieml.org/test/1.0/arrays.1.aml")

## Not run: 
# See source at:
# https://drive.google.com/open?id=1oYHXxvzscBBSBhd6xg5ckUEZo3tLytk9zY0VV_Y7SGs
library(googledrive)
aml_to_json(as_id("1oYHXxvzscBBSBhd6xg5ckUEZo3tLytk9zY0VV_Y7SGs"),
  pretty = TRUE)

## End(Not run)

rchie documentation built on May 8, 2019, 1:03 a.m.