dataset_json {datasetjson}R Documentation

Create a Dataset JSON Object

Description

Create the base object used to write a Dataset JSON file.

Usage

dataset_json(
  .data,
  file_oid = NULL,
  last_modified = NULL,
  originator = NULL,
  sys = NULL,
  sys_version = NULL,
  study = NULL,
  metadata_version = NULL,
  metadata_ref = NULL,
  item_oid = NULL,
  name = NULL,
  dataset_label = NULL,
  columns = NULL,
  version = "1.1.0"
)

Arguments

.data

Input data to contain within the Dataset JSON file. Written to the itemData parameter.

file_oid

fileOID parameter, defined as "A unique identifier for this file." (optional)

last_modified

The date/time the source database was last modified before creating the Dataset-JSON file (optional)

originator

originator parameter, defined as "The organization that generated the Dataset-JSON file." (optional)

sys

sourceSystem.name parameter, defined as "The computer system or database management system that is the source of the information in this file." (Optional, required if coupled with sys_version)

sys_version

sourceSystem.Version, defined as "The version of the sourceSystem" (Optional, required if coupled with sys)

study

Study OID value (optional)

metadata_version

Metadata version OID value (optional)

metadata_ref

Metadata reference (i.e. path to Define.xml) (optional)

item_oid

ID used to label dataset with the itemGroupData parameter. Defined as "Object of Datasets. Key value is a unique identifier for Dataset, corresponding to ItemGroupDef/@OID in Define-XML."

name

Dataset name

dataset_label

Dataset Label

columns

Variable level metadata for the Dataset JSON object. See details for format requirements.

version

The DatasetJSON version to use. Currently only 1.1.0 is supported.

Details

The columns parameter should be provided as a dataframe based off the Dataset JSON Specification:

Note that DatasetJSON is on version 1.1.0. Based off findings from the pilot, version 1.1.0 reflects feedback from the user community. Support for 1.0.0 has been deprecated.

Value

dataset_json object pertaining to the specific Dataset JSON version specific

Examples

# Create a basic object
ds_json <- dataset_json(
  iris,
  file_oid = "/some/path",
  last_modified = "2023-02-15T10:23:15",
  originator = "Some Org",
  sys = "source system",
  sys_version = "1.0",
  study = "SOMESTUDY",
  metadata_version = "MDV.MSGv2.0.SDTMIG.3.3.SDTM.1.7",
  metadata_ref = "some/define.xml",
  item_oid = "IG.IRIS",
  name = "IRIS",
  dataset_label = "Iris",
  columns = iris_items
)

# Attach attributes directly
ds_json <- dataset_json(iris, columns = iris_items)
ds_json <- set_file_oid(ds_json, "/some/path")
ds_json <- set_last_modified(ds_json, "2025-01-21T13:34:50")
ds_json <- set_originator(ds_json, "Some Org")
ds_json <- set_source_system(ds_json, "source system", "1.0")
ds_json <- set_study_oid(ds_json, "SOMESTUDY")
ds_json <- set_metadata_ref(ds_json, "some/define.xml")
ds_json <- set_metadata_version(ds_json, "MDV.MSGv2.0.SDTMIG.3.3.SDTM.1.7")
ds_json <- set_item_oid(ds_json, "IG.IRIS")
ds_json <- set_dataset_name(ds_json, "Iris")
ds_json <- set_dataset_label(ds_json, "The Iris Dataset")

[Package datasetjson version 0.3.0 Index]