init_labs {labelr}R Documentation

Initialize labelr Attributes

Description

init_labs pre-populates a data.frame with "placeholder" labelr label meta- data, which will be overwritten if/when you explicitly assign your own preferred label attributes.

Usage

init_labs(data, max.unique.vals = 5000)

Arguments

data

the data.frame that you will be labeling via functions like add_val_labs and add_name_labs.

max.unique.vals

constrains the variables that may receive value labels to those whose total unique values do not exceed the integer value supplied to this argument. Note that labelr sets a hard ceiling of 5000 on the total number of unique value labels that any variable is permitted to have under any circumstance, as labelr is primarily intended for interactive use with moderately-sized (<=~1M-row) data.frames.

Details

init_labs is used inside other labelr functions but is not intended for interactive use at the console.

Value

a data.frame with initial placeholder labelr meta-data added.

Examples

# make toy demographic (gender, race, etc.) data set
set.seed(555)
df <- make_demo_data(n = 1000) # another labelr:: function
df2 <- init_labs(df) # df2 is not df
get_all_lab_atts(df) # this is df; is not df2
get_all_lab_atts(df2) # this is df2

[Package labelr version 0.1.5 Index]