Skip to contents

Converts a tibble to a list for input options in ComboBox & Dropdowns of shiny.fluent library

Usage

convert_tibble_to_list(
  data = tibble::tibble(),
  key_col = character(),
  text_col = character(),
  null_value = FALSE,
  i18n = character()
)

Arguments

data

A tibble or a dataframe containing data

key_col

Name of the column containing the key (character)

text_col

Name of the column containing the text (character)

null_value

Add a null value at the beginning (logical)

i18n

Translator object from shiny.i18n library

Value

A list with this structure : list(list(key = "my_key1", text = "my_text1"), list(key = "my_key2", text = "my_text2"))

Examples

data <- tibble::tribble(~key, ~text, "my_key1", "my_text1", "my_key2", "my_text2")
my_list <- convert_tibble_to_list(data = data, key_col = "key", text_col = "text", null_value = TRUE, i18n = i18n)
#> Error in convert_tibble_to_list(data = data, key_col = "key", text_col = "text",     null_value = TRUE, i18n = i18n): could not find function "convert_tibble_to_list"
print(my_list)
#> Error in eval(expr, envir, enclos): object 'my_list' not found