from_aml: Import ArchieML data from a string, file, or URL

View source: R/from_aml.R

from_amlR Documentation

Import ArchieML data from a string, file, or URL

Description

This imports data from New York Times' ArchieML format as an R object. Text is parsed to JSON using archieml-js, then imported via jsonlite::fromJSON.

Usage

from_aml(aml, simplifyVector = FALSE,
  simplifyDataFrame = simplifyVector, simplifyMatrix = simplifyVector,
  flatten = FALSE, ...)


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 file names will always be treated as raw ArchieML. To read multiple ArchieML inputs use a function such as lapply.

simplifyVector, simplifyDataFrame, simplifyMatrix, flatten

passed to fromJSON to determine how the JSON generated from is parsed. If raw JSON outputs are desired use aml_to_json

...

further arguments to be passed tojsonlite::fromJSON, for class-specific print methods

Details

This function was formerly named from_archie, which is now deprecated.

Value

A list of class "from_aml"

References

http://archieml.org/

See Also

aml_to_json

Examples

from_aml(aml = "key: value")
from_aml("http://archieml.org/test/1.0/arrays.1.aml")

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

## End(Not run)

ropensci/rchie documentation built on Oct. 7, 2022, 9:22 a.m.