list_to_dict: Go from a named list to a key-value data frame or data...

Description Usage Arguments Examples

View source: R/metadata.R

Description

Sometimes, you'll want to have variable labels in a data.frame, sometimes you'll have imported an existing data dictionary and will need to turn it into a list before setting labelled::var_label().

Usage

1
2
3
list_to_dict(named_list)

dict_to_list(dict)

Arguments

named_list

a named list with one element each (names being variable names, elements being labels)

dict

a data frame with the variable names in the first and the labels in the second column. If they are named variable and label, they can also be in a different order.

Examples

1
2
3
4
5
6

codebook documentation built on July 1, 2020, 10:28 p.m.