Learn R Programming

rjstat (version 0.4.3)

fromJSONstat: Convert JSON-stat format to data frame(s)

Description

This function takes a JSON-stat format response and returns a data frame or a list of data frames, with columns for each dimension and one value column.

Usage

fromJSONstat(x, naming = "label", use_factors = FALSE, silent = FALSE)

Value

For responses with class dataset: A data frame. For responses with class collection: An unnamed list of one or more lists or data frames. For responses with class bundle: A named list of one or more data frames.

Arguments

x

JSON-stat format response, or path or URL to such a response

naming

whether to use (longer) labels or (shorter) ids

use_factors

whether dimension categories should be factors or character objects

silent

suppress warnings

Examples

Run this code
if (FALSE) {
oecd.canada.url <- "https://json-stat.org/samples/oecd-canada.json"
results <- fromJSONstat(oecd.canada.url)
names(results)
}

Run the code above in your browser using DataLab