Skip to contents

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

Arguments

x

a vector

...

Further parameters for inheritance, not in use.

value

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

Value

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

Details

get_variable_definitions() is identical to var_definition().

Examples

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)
#> [1] "http://data.europa.eu/bna/c_6c2bb82d"
# To remove a definition of measure
var_definition(small_country_dataset$country_name) <- NULL