choices_labeled: Set "<choice>:<label>" type of names

View source: R/choices_labeled.R

choices_labeledR Documentation

Set "⁠<choice>:<label>⁠" type of names

Description

[Stable]

This is often useful for as it marks up the drop-down boxes for shiny::selectInput().

Usage

choices_labeled(choices, labels, subset = NULL, types = NULL)

Arguments

choices

(character or numeric or logical) vector

labels

(character) vector containing labels to be applied to choices. If NA then "Label Missing" will be used.

subset

a vector that is a subset of choices. This is useful if only a few variables need to be named. If this argument is used, the returned vector will match its order.

types

vector containing the types of the columns.

Details

If either choices or labels are factors, they are coerced to character. Duplicated elements from choices get removed.

Value

A named character vector.


teal.slice documentation built on May 29, 2024, 1:39 a.m.