read_pfa: read_pfa

Description Usage Arguments Value Examples

Description

Convert a JSON string in memory or a JSON file on disk into a list-of-lists structure.

Usage

1

Arguments

x

A string, file or url connection

Value

a list of lists structure in which null -> NULL, true -> TRUE, false -> FALSE, numbers -> numeric, strings -> character, array -> list, object -> named list

Examples

1
2
3
4
5
6
7
8
9
# literal JSON string  (useful for small examples)
toy_model <- read_pfa('{"input":"double","output":"double","action":[{"+":["input",10]}]}')

# from a local path, must be wrapped in "file" command to create a connection
local_model <- read_pfa(file(system.file("extdata", "my-model.pfa", package = "aurelius")))

# from a url (split on two lines so not to exceed 100 char wide during install)
url_model <- read_pfa(url(paste0('https://raw.githubusercontent.com/ReportMort/hadrian', 
                     '/feature/add-r-package-structure/aurelius/inst/extdata/my-model.pfa')))

aurelius documentation built on May 2, 2019, 3:43 a.m.