jsonstat (version 0.0.2)

toJSON.jsonstat.dataset: Convert JSON-stat dataset into JSON

Description

Convert JSON-stat dataset into JSON

Usage

# S3 method for jsonstat.dataset
toJSON(x, auto_unbox = F)

Arguments

x

JSON-stat dataset

auto_unbox

this flag marks atomic vectors in given list as a singleton, so it will not turn into an 'array' when encoded into JSON. FALSE by default.

Value

JSON output

Examples

Run this code
# NOT RUN {
library(jsonstat)
library(dplyr)

.plan <- compress_plan("place.of.birth", "geo", "Place of Birth") %>%
  dimension("age.group", "classification", "Age Group") %>%
  dimension("gender", "classification", "Gender") %>%
  dimension("year", "time", "Year") %>%
  dimension("province.of.residence", "geo", "Province of Residence") %>%
  dimension("concept", "metric", "Concept") %>%
  dimension("value", "value", "value")

.dataset <- as.dataset(galicia, .plan,
              label = paste("Population by province of residence,",
                            "place of birth, age, gender and year",
                            "in Galicia"),
              href = "https://github.com/zedoul/jsonstat")

.jsonstat <- toJSON(.dataset)
# }

Run the code above in your browser using DataCamp Workspace