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.

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

Value

A list of class "from_aml"

Details

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

References

http://archieml.org/

See also

Examples

from_aml(aml = "key: value")
#> $key #> [1] "value" #> #> attr(,"class") #> [1] "list" "from_aml"
from_aml("http://archieml.org/test/1.0/arrays.1.aml")
#> $test #> [1] "[array] creates an empty array at array" #> #> $result #> [1] "{\"array\": []}" #> #> $array #> list() #> #> attr(,"class") #> [1] "list" "from_aml"
# See source at: # https://drive.google.com/open?id=1oYHXxvzscBBSBhd6xg5ckUEZo3tLytk9zY0VV_Y7SGs library(googledrive) from_aml(as_id("1oYHXxvzscBBSBhd6xg5ckUEZo3tLytk9zY0VV_Y7SGs"))
#> $key #> [1] "value" #> #> $`google-link` #> [1] "This is a link." #> #> $`google-link-standalone` #> [1] "http://www.nytimes.com/2016/04/03/us/politics/donald-trump-general-election.html?q=1#1" #> #> $`google-link-standalone-raw` #> [1] "http://www.nytimes.com/2016/04/03/us/politics/donald-trump-general-election.html?q=1#1" #> #> $`smart-quotes` #> [1] "<a href=“http://www.nytimes.com”>nytimes.com</a>" #> #> $array #> $array[[1]] #> [1] "1" #> #> $array[[2]] #> [1] "2" #> #> #> $`heading-link` #> [1] "Link to heading 1" #> #> $heading1 #> [1] "Heading 1" #> #> $heading2 #> [1] "Heading 2" #> #> $heading3 #> [1] "Heading 3" #> #> $heading4 #> [1] "Heading 4" #> #> $heading5 #> [1] "Heading 5" #> #> $heading6 #> [1] "Heading 6" #> #> $nbsp #> [1] "Internal &nbsp;s are not converted" #> #> $`bold-word` #> [1] "This word is bolded." #> #> $`italic-word` #> [1] "This word is italicized." #> #> $`underline-word` #> [1] "This word is underlined." #> #> $`styled-word` #> [1] "This word has many styles." #> #> $`strange-word` #> [1] "This word is strange, but bold." #> #> $`bold-value` #> [1] "This value is bolded." #> #> $`italic-value` #> [1] "This value is italicized." #> #> $`underline-value` #> [1] "This value is underlined." #> #> $`styled-value` #> [1] "This value has many styles." #> #> $`bold-line` #> [1] "This line is bolded." #> #> $`italic-line` #> [1] "This line is italicized." #> #> $`underline-line` #> [1] "This line is underlined." #> #> $`styled-line` #> [1] "This line has many styles." #> #> $`soft-line-breaks` #> [1] "Are treated as hard line breaks" #> #> attr(,"class") #> [1] "list" "from_aml"