util_ensure_label: Utility function ensuring valid labels and variable names

View source: R/util_ensure_label.R

util_ensure_labelR Documentation

Utility function ensuring valid labels and variable names

Description

Valid labels should not be empty, be unique and do not exceed a certain length. This also applies to the VAR_NAMES. When adjusting the VAR_NAMES, we have to ensure that we do not introduce additional matches or mismatches between the column names of the study data and the VAR_NAMES column in the metadata.

Usage

util_ensure_label(
  study_data,
  meta_data,
  label_col,
  max_label_len = MAX_LABEL_LEN
)

Arguments

study_data

data.frame the data frame that contains the measurements

meta_data

data.frame the data frame that contains metadata attributes of study data

label_col

variable attribute the name of the column in the metadata with labels of variables

max_label_len

integer maximum length for the labels, defaults to 30.

Value

a list containing the study data, possibly with adapted column names, the metadata, possibly with adapted labels, and a string and a table informing about the changes


dataquieR documentation built on May 29, 2024, 7:18 a.m.