olat_eval_adjust_lang: Adjust language of variables/columns

View source: R/olat_eval.R

olat_eval_adjust_langR Documentation

Adjust language of variables/columns

Description

Modifies the names of the variables in the dat.frame as read from the xlsx file (OpenOLAT). Converts the variable names to English such that we do no longer have to care about language in all other methods/functions.

Usage

olat_eval_adjust_lang(x)

Arguments

x

data.frame read from the xlsx file

Details

Input 'x' is the data.frame as read from the xlsx file which contains user meta information and the detailed information about the individual questions of the test. Problem: depending on the user language settings of OLAT the names and order of the columns differs. This function takes input 'x' and manipulates the variable or column names in a way that the rest of the code (olat_eval) is not language dependent anymore.

  • tries to guess the language by calling olat_eval_guess_lang

  • loads the search-replace-data.frame (internally)

  • search and replace variable names

  • return input object x with new varaible names

Note: Even English to English will rename some of the variables.

The function uses the data set olat_eval_lang which is shipped with the package (see data("olat_eval_lang")).

Value

Returns the same data.frame (same dimension and data) with adjusted names.

Author(s)

Reto


c403 documentation built on Oct. 20, 2023, 3:01 p.m.