Meta information that is part of i_labeled objects:
Meta information can be applied via the class constructor i_labelled
(as seen above) or by dedicated functions. Adding meta information by
base R’s attr()
function is also possible.
myVariable <- i_labelled(c(1, 2, 3, -9, NA))
myVariable <- myVariable |>
i_label("my variable label") |>
i_labels(
"A" = 1,
"B" = 2,
"C" = 3,
"X" = -9
) |>
i_na_range(c(-9,-1)) |>
i_scale("nominal") |>
i_subject("dummy data")
myVariable
#> <i_labelled double>
#> [1] 1 2 3 -9 NA
#>
#> Subject:
#> dummy data
#>
#> Missing range: [-9:-1]
#>
#> Scale level: nominal
#>
#> Variable label:
#> my variable label
#>
#> Value labels:
#> value label
#> -9 X
#> 1 A
#> 2 B
#> 3 C