sjmisc_get_labels: sjmisc 1.8 hack

sjmisc_get_labelsR Documentation

sjmisc 1.8 hack

Description

sjmisc 1.8 hack, value labels

Usage

sjmisc_get_labels(
  x,
  attr.only = FALSE,
  include.values = NULL,
  include.non.labelled = FALSE
)

Note

include.values, how values are returned: NULL = unnamed vector; as named vector = "as.name" or "n"; "as.prefix" or "p", c("[1] Caucasian", "[3] Asian")
attr.only = T, only search attributes, T desired (if F, also search factor levels, character strings)
include.non.labelled, if T, values without labels will also be included in the returned labels
returns NULL if no value labels attribute
returned vector values are the labels with vector names being initial values in x. This is flipped as you would get directly from attr(,"labels",exact=T)


jerryzhujian9/zmisc documentation built on March 9, 2024, 12:49 a.m.