# The defined vector class and dataset_df support units of measure attributes:
var_unit(iris_dataset$Sepal.Length)
# Normally columns of a data.frame do not have a unit attribute:
var_unit(iris$Sepal.Length)
# You can add them with the assignment function:
var_unit(iris$Sepal.Length) <- "centimeter"
# To remove a unit of measure assign the NULL value:
var_unit(iris$Sepal.Length) <- NULL
Run the code above in your browser using DataLab