
Set dictionary information to variables
set_dic.RdSet dictionary information to variables
Details
Standard attributes are: "item_name", "item_label", "weight",
"type", "values", "value_labels", "missing".
Examples
hap_1 <- sample(1:5, 30, replace = TRUE)
set_dic(hap_1,
item_label = "How do you feel today?",
scale = "hap",
scale_label = "Happiness",
values = 1:3,
value_labels = "1 = not happy; 2 = in between; 3 = happy"
)
#>
#> Cautions:
#> 1: Attribute 'item_name' missing and set to 'hap_1'.
#> 2: Attribute 'type' missing and set to 'integer'.
#> 3: Attribute 'weight' missing and set to 1.
#> ║How do you feel today? (Happiness)
#> ║Data type is integer
#> ║Valid values: 1:3
#> ║Value labels:
#> ║ 1 = not happy
#> ║ 2 = in between
#> ║ 3 = happy
#> ║Length: 30 (0 missing)
#> ║ [1] 5 5 5 5 3 4 2 1 1 4 2 1 4 5 5 5 2 1 5 1 1 3 2 1 4 1 3 2 1 5