build_custom_mapping: Build column name mappings

Description Usage Arguments Details Value

View source: R/data_preparation.R

Description

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

Usage

1
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.


logib documentation built on Aug. 27, 2020, 5:06 p.m.