read_dataset_json {datasetjson}R Documentation

Read a Dataset JSON to datasetjson object

Description

This function validates a dataset JSON file against the Dataset JSON schema, and if valid returns a datasetjson object. The Dataset JSON file can be either a file path on disk of a URL which contains the Dataset JSON file.

Usage

read_dataset_json(file, decimals_as_floats = FALSE)

Arguments

file

File path or URL of a Dataset JSON file

decimals_as_floats

Convert variables of "decimal" type to float

Details

The resulting dataframe contains the additional metadata available on the Dataset JSON file within the attributes to make this accessible to the user. Note that these attributes are only populated if available.

Value

A dataframe with additional attributes attached containing the DatasetJSON metadata.

Examples

# Read from disk
## Not run: 
  dat <- read_dataset_json("path/to/file.json")
 # Read file from URL
  dat <- dataset_json('https://www.somesite.com/file.json')

## End(Not run)

# Read from an already imported character vector
ds_json <- dataset_json(iris, "IG.IRIS", "IRIS", "Iris", columns=iris_items)
js <- write_dataset_json(ds_json)
dat <- read_dataset_json(js)

[Package datasetjson version 0.3.0 Index]