Learn R Programming

sjmisc (version 1.7)

get_note: Retrieve notes (annotations) from labelled variables

Description

This function retrieves the value of the note-attribute of vectors.

Usage

get_note(x)

Arguments

x
Variable (vector) with note-attribute.

Value

  • The the value of the note-attribute of x.

Examples

Run this code
# create labelled factor, with missing flag
x <- labelled(c("M", "M", "F", "X", "N/A"),
              c(Male = "M", Female = "F",
                Refused = "X", "Not applicable" = "N/A"),
              c(FALSE, FALSE, TRUE, TRUE))

set_label(x) <- "A labelled vector with note"
set_note(x) <- "Test annotation."
get_note(x)
x

Run the code above in your browser using DataLab