R/unify_selection.R

Defines functions unify_selection

Documented in unify_selection

#' unify selections to handle "classic" (bootRes-style) selections
#'
#' @param selection a treeclim selection
#'
#' @return unified (list-style) selection
#'
#' @keywords internal
unify_selection <- function(selection) {
  ## when numeric vector = "classic" (bR 1.X) parameter selection
  if (is.numeric(selection)) {
    selection <- eval(
      substitute(
        .range(.months = sel, .variables = NULL),
        list(sel = selection)
      )
    )
  }
  selection
}

Try the treeclim package in your browser

Any scripts or data that you put into this service are public.

treeclim documentation built on March 18, 2022, 7:22 p.m.