ropensci/rchie

Name: rchie

Owner: rOpenSci

Description: An R parser for ArchieML

Created: 2015-03-07 15:19:39.0

Updated: 2017-12-16 20:06:11.0

Pushed: 2016-04-01 18:29:06.0

Homepage:

Size: 283

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status AppVeyor Build Status codecov.io

An R parser for ArchieML

This package is a wrapper for archieml-js, a parser for the New York Times' ArchieML format. ArchieML is designed to include structured data in free-form documents.

Right now it just has one function, from_archie, which loads ArchieML data from a string, file, or URL.

archieml-js (included under inst, using git subtree) parses ArchieML to JSON. It is run using V8, and then the JSON data is imported via jsonlite.

Install

Note that, because it uses the V8 package, rchie has a system requirement of libv8.

library(devtools)
install_github('ropensci/rchie')
Usage

from_archie can read ArchieML from a string, file, or URL:

ary(rchie)
1 = "
rrayName]

remy spoke with her on Friday, follow-up scheduled for next week
me: Amanda
e: 26

Contact: 434-555-1234
me: Tessa
e: 30




_archie(data1)          
arrayName
   name age
 Amanda  26
  Tessa  30
_archie('http://archieml.org/test/1.0/arrays.1.aml')
o encoding supplied: defaulting to UTF-8.
test
1] "[array] creates an empty array at array"

result
1] "{\"array\": []}"

array
ist()

Note that you can pass arguments through from_archie to jsonlite::fromJSON to determine how JSON is converted to R objects:

_archie(data1, simplifyVector=FALSE)
arrayName
arrayName[[1]]
arrayName[[1]]$name
1] "Amanda"

arrayName[[1]]$age
1] "26"


arrayName[[2]]
arrayName[[2]]$name
1] "Tessa"

arrayName[[2]]$age
1] "30"

See http://archieml.org/ for more examples of ArchieML

ropensci\_footer


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.