R/distinct_input_select_years.R

Defines functions distinct_input_select_years

Documented in distinct_input_select_years

#' Reorder years and create a vector variable for the input panel
#'
#' @param data raw data
#'
#' @importFrom dplyr select arrange distinct pull
#'
#' @return an ordered vector
#'
#' @export
#'
distinct_input_select_years <- function(data) {

  data %>%
    dplyr::select(year) %>%
    dplyr::arrange(year) %>%
    dplyr::distinct() %>%
    dplyr::pull() %>%
    {
      c("All years", .)
    }

}
virtual-pollination-trade/virtual-biotic-pollination-flow documentation built on May 3, 2021, 4:40 p.m.