Create a string or factor vector based on value labels in matching metadata
label_data(data = d, variable.data = varcode, variable.meta = variable.data, metadata = meta, into.factor = TRUE)
data | A data.frame including the source variable to be labeled |
---|---|
variable.data | Code of the source variable in data.frame |
variable.meta | Code of the source variable in the matching metadata |
metadata | A tidy metadata |
into.factor | Whether the output variable should be converted into a factor or not |
vector
# NOT RUN { label_data(data=d, variable.data="sex", variable.meta=variable.data, metadata=meta, into.factor=TRUE) # }