View source: R/dic-constructor.R
set_dic | R Documentation |
Set dictionary information to variables
set_dic(data, .vars = NULL, ...)
data |
A data frame or a vector. |
.vars |
Character vector with variable names. If data is a data frame,
address these variables. If left |
... |
dic attributes of the form |
Standard attributes are: "item_name"
, "item_label"
, "weight"
,
"type"
, "values"
, "value_labels"
, "missing"
.
A data frame or a vector with added dic attributes.
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"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.