Learn R Programming

dataset (version 0.3.1)

DataStructure: Data structure

Description

Read or update the Data Structure Definition of a dataset.

Usage

DataStructure(x)

DataStructure_update(x, value)

Value

A dataset object, which is a data.frame or inherited object with rich metadata.

Arguments

x

A dataset.

value

A DataStructure definition.

Examples

Run this code
DataStructure(iris_dataset)
dsd_iris <- DataStructure(iris_dataset)
dsd_iris$Sepal.Length$label <- "The sepal length measured in centimeters."
dsd_iris$Sepal.Width$label  <- "The sepal width measured in centimeters."
dsd_iris$Petal.Length$label <- "The petal length measured in centimeters."
dsd_iris$Petal.Width$label  <- "The petal width measured in centimeters."
dsd_iris$Species$label      <- "The name of the Iris species in the observation."

iris_dataset_labelled <- DataStructure_update(iris_dataset, dsd_iris)

vapply(DataStructure(iris_dataset_labelled), function(x) x$label, character(1))

Run the code above in your browser using DataLab