| get_note {sjlabelled} | R Documentation |
This function retrieves the value of the note-attribute
of vectors.
get_note(x)
x |
Variable (vector) with note-attribute. |
The the value of the note-attribute of x.
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
# Annotate simple vector
x <- c(1, 2, 3)
set_note(x) <- "Another note"
x
get_note(x)