| set_note {sjlabelled} | R Documentation |
This function adds a note (string) as note-attribute
to x.
set_note(x, value = NULL) set_note(x) <- value
x |
Variable (vector). |
value |
The note (annotation) as character string that will be added as
|
x, with value stored as attribute.
library(haven)
# create labelled factor
x <- labelled(c("M", "M", "F", "X", "N/A"),
c(Male = "M", Female = "F",
Refused = "X", "Not applicable" = "N/A"))
set_label(x) <- "A labelled vector with note"
set_note(x) <- "Test annotation."
get_note(x)
x