gather_languages: Gather Fields with Multiple Language Values

View source: R/simplify_utilities.R

gather_languagesR Documentation

Gather Fields with Multiple Language Values

Description

This function extracts the values for a preferred language from a list containing values in multiple languages.

Usage

gather_languages(input_list, language = "all", silent = FALSE)

Arguments

input_list

A list with character values containing (or not) sublists for each language.

language

The short name (e.g. "en", "de", "fr") of the language that is preferred for the fields. Special value "all" (the default) can be used to return a concatenated string of all available languages. gather_languages() will select other available languages in alphabetical order if the selected language is not available.

silent

TRUE/FALSE: Should gather_languages() issue messages and warnings?

Value

A character vector containing the values in the preferred language.

See Also

  • This function is used by: simplify_idaifield()

Examples

## Not run: 
input_list <- list(list("en" = "English text", "de" = "Deutscher Text"),
                   list("en" = "Another english text", "de" = "Weiterer dt. Text"))
gather_languages(input_list, language = "de")

## End(Not run)

lsteinmann/idaifieldR documentation built on April 3, 2025, 2:06 p.m.