ez.label.get: get variable label, wrapper of 'sjmisc_get_label'

ez.label.getR Documentation

get variable label, wrapper of sjmisc_get_label

Description

get variable label, wrapper of sjmisc_get_label

Usage

ez.label.get(x, col = NULL)

ez.getlabel(x, col = NULL)

Arguments

x

a df: (efc), or a single var: (efc$e42dep)

col

evaluated by ez.selcol(x,col). Or, NULL=all cols. returns only labels for specified cols of the df (ignored if x is a var)

Value

returns a named character vector (if x is df), or character (if x is a single var)
If df has no variable label for all variables or for specified cols, returns NULL. If df has label for some variables, returns a string vector with some "".
If a single variable has no label, returns NULL

Note

if df uses foreign style 'variable.labels' and
because of renaming, new col name is not in 'variable.labels',
the function will not retrieve label for that new col name during the process, which is obvious

See Also

gather, spread, separate, unite
select, slice
distinct, arrange
summarise, count, mutate
group_by, left_join, right_join, inner_join, full_join, semi_join, anti_join
intersect, union, setdiff
bind_rows, bind_cols

Other data transformation functions: ez.2char(), ez.2factor(), ez.2label(), ez.2long(), ez.2lower(), ez.2value(), ez.2wide(), ez.compute(), ez.del(), ez.label.set(), ez.labels.get(), ez.labels.set(), ez.move(), ez.newcol(), ez.num(), ez.recode(), ez.recols(), ez.recol(), ez.rename(), ez.replace(), ez.rncols(), ez.rncol(), ez.select(), ez.sort(), ez.split(), ez.str(), ez.unique(), left_join()


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