diff --git a/R/choices_labeled.R b/R/choices_labeled.R index a3e1a8825..5a5461ea8 100644 --- a/R/choices_labeled.R +++ b/R/choices_labeled.R @@ -4,7 +4,7 @@ #' This is often useful for [choices_selected] as it marks up the dropdown boxes #' for [shiny::selectInput()]. #' -#' @param choices A character / factor / numeric / logical vector of length > 1. +#' @param choices A character / factor / numeric / logical vector. #' @param labels character vector containing labels to be applied to `choices`. If `NA` then #' "Label Missing" will be used. #' @param subset a vector that is a subset of `choices`. This is useful if @@ -60,12 +60,7 @@ choices_labeled <- function(choices, labels, subset = NULL, types = NULL) { choices <- as.character(choices) } - checkmate::assert( - checkmate::check_character(choices, min.len = 2, any.missing = FALSE), - checkmate::check_factor(choices, min.len = 2, any.missing = FALSE), - checkmate::check_numeric(choices, min.len = 2, any.missing = FALSE), - checkmate::check_logical(choices, min.len = 2, any.missing = FALSE) - ) + checkmate::assert_atomic(choices, min.len = 1, any.missing = FALSE) if (is.factor(labels)) { labels <- as.character(labels) diff --git a/man/choices_labeled.Rd b/man/choices_labeled.Rd index 36a812fb2..d03d89381 100644 --- a/man/choices_labeled.Rd +++ b/man/choices_labeled.Rd @@ -10,7 +10,7 @@ choices_labeled(choices, labels, subset = NULL, types = NULL) \method{print}{choices_labeled}(x, ...) } \arguments{ -\item{choices}{A character / factor / numeric / logical vector of length > 1.} +\item{choices}{A character / factor / numeric / logical vector.} \item{labels}{character vector containing labels to be applied to \code{choices}. If \code{NA} then "Label Missing" will be used.}