Skip to contents

[Stable] This is often useful for as it marks up the dropdown boxes for shiny::selectInput().

Usage

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

Arguments

choices

a character / numeric / 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.

Value

a named character vector

Details

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