build_custom_mapping: Build column name mappings

View source: R/data_preparation.R

build_custom_mappingR Documentation

Build column name mappings

Description

build_custom_mapping creates a vector of column name mappings for the user to read her or his custom dataframe

Usage

build_custom_mapping(data, language = "de", prompt_mapping = TRUE)

Arguments

data

the custom dataframe for which the user wants to build a custom mapping

language

a character string representing the language in which the columns will be displayed during the mapping prompt ("de" or "fr" or "it" or "en")

prompt_mapping

a boolean indicating whether the function prompts the user for the exact mapping of his dataframe or whether the columns are mapped automatically by order

Details

Builds a mapping from the custom column names of a given data.frame to the variable names used in the standard analysis model. If prompt_mapping is set to TRUE, the function prompts the mapping for each column of the data.frame. If prompt_mapping is set to FALSE, the mapping is built using the order of the columns of the given data.frame.

Value

A named vector of characters, where the name indicates the column name in the original data.frame and the value indicates the column name as used by the standard analysis model.


JLDC/logib documentation built on Jan. 12, 2025, 4:13 p.m.