gdp_vector <- defined(
c(3897, 7365, 6753),
label = "Gross Domestic Product",
unit = "million dollars",
definition = "http://data.europa.eu/83i/aa/GDP"
)
# To check the s3 class of the vector:
is.defined(gdp_vector)
# To print the defined vector:
print(gdp_vector)
# To summarise the defined vector:
summary(gdp_vector)
# Subsetting work as expected:
gdp_vector[1:2]
Run the code above in your browser using DataLab