Learn R Programming

dataset (version 0.3.4)

var_definition: Get / set a definition for a vector or a dataset

Description

Get / set a definition for a vector or a dataset

Usage

var_definition(x, ...)

var_definition(x) <- value

definition_attribute(x)

get_definition_attribute(x)

set_definition_attribute(x, value)

definition_attribute(x) <- value

Value

The (linked) definition of the meaning of the data contained by a vector constructed with defined.

Arguments

x

a vector

...

Further parameters for inheritance, not in use.

value

a character string or NULL to remove the definition of measure.

Details

get_variable_definitions() is identical to var_definition().

Examples

Run this code
small_country_dataset <- dataset_df(
  country_name = defined(c("Andorra", "Lichtenstein"), label  = "Country"),
  gdp = defined(c(3897, 7365),
                      label = "Gross Domestic Product",
                      unit = "million dollars")
)
var_definition(small_country_dataset$country_name) <- "http://data.europa.eu/bna/c_6c2bb82d"
var_definition(small_country_dataset$country_name)
# To remove a definition of measure
var_definition(small_country_dataset$country_name) <- NULL

Run the code above in your browser using DataLab