Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

build_custom_mapping

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.


logib

Salary Analysis by the Swiss Federal Office for Gender Equality

v0.1.0
GPL-3
Authors
Jonathan Chassot [aut, cre], Jeremy Kolly [ctb], Federal Office for Gender Equality of Switzerland [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.